Software version: Latest from Android App store - Mayola
I have tested this on 5 Android devices with 5 different accounts, all of them on different networks with just IPv4 NAT - no firewalls on the router blocking any ports. All the devices have DHT enabled, UPnP enabled, TURN enabled, Local peer discovery enabled. All of them have a "username".
All the 5 devices have each other in their contact list.
I brought all the contacts online.
Then I chose one device and manually turned it to offline - by flicking the toggle switch in the Accounts tab.
Then I disabled WiFi on that same device. Mobile data was also disabled.
Now even after 2 hours - this device which is Offline is appearing as online for the other clients.
I notice there is a field called Registration Expire in the Advanced section of accounts - what is it supposed to do? it is currently defaulting to 60 - is it seconds or minutes or hours?
Edited
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
I notice that the issue is also present in QT client on Linux, so I wonder whether it is actually an UI issue or whether your server is sending an incorrect status.
This isn't a bug. you have the proxy enabled, so till the dht proxy listen for the device and put the presence, the presence will be detected. And the proxy listens for 12 hours (and send an expire notification 2h before). However the qt client you have its presence disappears after ~10 min
Registration Expire should not be shown for Jami account but for SIP ones
Thank you for your reply, Registration expire is appearing under Bootstrap server, the value is probably hardcoded to 60. If I change it to any value other than 60, the value changes however when I change to another screen and come back to check the value, it reverts to 60.
I am trying to debug this online status to resolve the messaging problems I have, as I would like this application to be usable. Right now the application works inconsistentaly and one has to perform ONLINE offline toggle every few hours to be able to send messages or receive (If the PUSH notifications are turned off).
I have devices with the above settings - it works when it works. However some of these devices go out of WiFi range and return back to wifi range. When such a scenario occurs the messages don't go through at all.
The second scenario is when the phone is with in the WiFi range but goes on to standby. Even though I have configured Android battery optimiser to go easy on Jami - and Jami is running in the background - the device doesn't receive any message or is able to send a message out, after the device has been idle for 10-15 minutes. If such a thing happens, I have to manually do an offline toggle on the accounts page to get it back online.
Regarding your assertion that I am using DHT proxy which keeps the state for 12 hours. I tried disabling DHT proxy on one of the Android clients, I also took the device offline by toggling the ONLINE status to offline under Accounts/Advanced section.
Expected: All contacts should go offline - all Android contacts went offline, however the QT contact which is my computer where the client was killed several hours ago (i.e offline) - was shown as ONLINE, even when the ANDROID application status is OFFLINE - this is definetly some bug.
When I enabled the application to go ONLINE, I expected the Android contacts to stay offline as I have disabled DHT proxy - only local peer discovery and TURN are enabled and none of the devices are actually online.
However all the Android clients became green as if they are ONLINE, needless to say I am not able to message them.
Messages are changing a lot those days. We are currently migrating to swarm that will change a loooot of things. In a few weeks it will be in beta (I already started some build for client-qt and it's in private alpha for android).
For registration there is an opened tickets for this, but yah for Jami accounts it's unused.
On mobiles (and not only on Jami, you can see the behaviour on many apps), the presence means that the key is present on the network, but you can't detect that a device is listening or not. This means that if you send a message, you will be able to encrypt the message.
Then, it depends on your settings, you can have a push notification that will wake the device up, get the value and put it to the callbacks (or without proxy directly the value put in the callbacks).
The interesting places are:
in daemon/src/jamidht/jamiaccount.cpp:
dht->listen
requestSIPConnection and onTextMessage (removed with swarm) can be useful too
Ok My mistake the scroll bar is not visible (it is barely visible no contrast from background (all other scroll bars appear orange in the device) when I click the scrollable area)- the proxy is disabled in QT client
Regarding the messages, I think the app was still being killed by Android inspite of my settings, I have changed some settings based on the website you have provided, I could send and receive messages after 15 minutes. Let me update you after 12 hours of idle.
Fixing the battery optimisation setting has resolved the "Undelivered message" issue.
But the incorrect status still persists -
Device A - Android - Settings are - Run as background service, UPnP enabled, Local peer discovery enabled, TURN enabled, STUN disabled, DHT Proxy disabled.
Device B - Ubuntu desktop - settings same as above.
Device B was powered off last night - it has been 12 hours since.
But Device A is still showing Device B as being online. There is a reproduceable bug.
When I turn off WiFi on Device A, all my other contacts who are on Android devices their status becomes offline.
However my desktop which is being offline and powered off for more than 12 hours is shown as ONLINE. Attaching the screen shot of Android device which shows the desktop being online.
This status doesn't change even if I take the android client OFFLINE - the only way the status gets cleared is by killing the background service. I think the background service is not refreshing its stored session for some reason. When the app is restarted after killing the service the QT Client is shown as Offline.
Second issue: This is on the QT client
I take Android device A offline.
After few minutes I am starting my desktop and the QT client for the first time, it has DHT proxy disabled, settings are as in the image in the previous message.
When I start the QT client on the desktop, I expect the Android device to appear offline because it is offline and is not using any proxy. However the Android device appears online. The following is the logs
Screen saver dbus interface: "org.freedesktop.ScreenSaver" NetworkManager client initialized, version: 1.12.4 , daemon running: yes , networking enabled: yes primary network connection: 51739746-c374-43f8-aaa9-0ff5a2850073 default: yes [1623476533.562| 8692|jamiaccount.cpp :886 ] Exported account to /home/krishnak/snap/jami/197/.local/share/jami/c5d569e96760f89b/config.yml [1623476533.562| 8692|jamiaccount.cpp :1801 ] [Account c5d569e96760f89b] Starting account.. [1623476533.562| 8797|jamiaccount.cpp :2717 ] Loading DhParams from file '/home/krishnak/snap/jami/common/.cache/c5d569e96760f89b/dhParams' [1623476533.562| 8692|jamiaccount.cpp :2547 ] [Account c5d569e96760f89b] connecting… [1623476533.562| 8692|jamiaccount.cpp :1709 ] UPnP: Attempting to map ports for Jami account [1623476533.562| 8692|upnp_context.cpp :297 ] Desired port is not set, will provide the first available port for [UDP] [1623476533.562| 8692|upnp_context.cpp :331 ] Did not find any available mapping. Will request one now [1623476533.563| 8692|upnp_context.cpp :1109 ] Port number not set. Will set a random port number [1623476533.565| 8692|upnp_context.cpp :1136 ] No IGD available. Mapping will be requested when an IGD becomes available [1623476533.565| 8692|mapping.cpp :89 ] Changing mapping JAMI-UDP:23325 state from AVAILABLE to UNAVAILABLE [1623476533.565| 8692|jamiaccount.cpp :1729 ] [Account c5d569e96760f89b] DHT UPNP mapping changed to JAMI-UDP:23325 (state=PENDING, auto-update=YES) [1623476533.565| 8692|jamiaccount.cpp :1768 ] [Account c5d569e96760f89b] Mapping request is in PENDING state: starting the DHT anyway [1623476533.566| 8793|jamiaccount.cpp :2000 ] [Account c5d569e96760f89b] Starting account... [1623476533.574| 8793|jamiaccount.cpp :1852 ] [Account c5d569e96760f89b] Bootstrap node: bootstrap.jami.net [1623476533.575| 8793|jamiaccount.cpp :1948 ] [Account c5d569e96760f89b] tracking buddy 4172b5b2d58bf627effaafc5112a105ae7dff43d [1623476533.575| 8793|upnp_context.cpp :612 ] UPNP/NAT-PMP enabled, but no valid IGDs available [1623476534.414| 8858|jamiaccount.cpp :2125 ] [Account c5d569e96760f89b] Dht status: IPv4 connecting; IPv6 disconnected [1623476534.415| 8858|jamiaccount.cpp :2125 ] [Account c5d569e96760f89b] Dht status: IPv4 connecting; IPv6 connecting [1623476534.726| 8858|jamiaccount.cpp :2125 ] [Account c5d569e96760f89b] Dht status: IPv4 connected; IPv6 connecting [1623476534.727| 8858|jamiaccount.cpp :2543 ] [Account c5d569e96760f89b] connected [1623476534.730| 8858|jamiaccount.cpp :3359 ] [Account c5d569e96760f89b] Store DHT public IPv4 address : REDACTED [1623476534.730| 8858|upnp_context.cpp :268 ] Setting the known public address to REDACTED [1623476534.731| 8860|jamiaccount.cpp :4325 ] [Account c5d569e96760f89b] Refresh cache for TURN server resolution [1623476536.489| 8860|jamiaccount.cpp :4397 ] [Account c5d569e96760f89b] Cache refreshed for TURN resolution [1623476539.185| 8801|pupnp.cpp :351 ] PUPnP: Start search for IGD: attempt 2 [1623476539.185| 8801|pupnp.cpp :260 ] PUPnP: Send IGD search request [1623476542.312| 8858|jamiaccount.cpp :1965 ] Buddy 4172b5b2d58bf627effaafc5112a105ae7dff43d online [1623476543.399| 8858|account_manager.cpp:198 ] announcing device at 8be1df7aa3a02714d7d3477e5a798574ab88f816 [1623476543.400| 8858|archive_account_manager.cpp:438 ] Building device sync from 51a4c961a5d58690866030d3bf9c0601d6a1ecb1 [1623476571.591| 8801|pupnp.cpp :351 ] PUPnP: Start search for IGD: attempt 3 [1623476571.592| 8801|pupnp.cpp :260 ] PUPnP: Send IGD search request [1623476575.372| 8858|account_manager.cpp:204 ] device announced at 8be1df7aa3a02714d7d3477e5a798574ab88f816 [1623476581.000| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out [1623476582.001| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out [1623476582.002| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out [1623476583.000| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out [1623476599.001| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out [1623476599.004| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out [1623476600.001| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out [1623476600.002| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out [1623476619.000| 8801|pupnp.cpp :351 ] PUPnP: Start search for IGD: attempt 4 [1623476619.000| 8801|pupnp.cpp :260 ] PUPnP: Send IGD search request [1623476631.000| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out [1623476632.000| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out [1623476632.000| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out [1623476632.035| 8858|jamiaccount.cpp :2125 ] [Account c5d569e96760f89b] Dht status: IPv4 connected; IPv6 disconnected [1623476633.001| 8809|pupnp.cpp :963 ] PUPnP: Received discovery search time-out
As you can see from the logs it is discovering the buddy to be online. This is misleading for a user.
Contact using a desktop version (in the local network) when goes offline - appears to be ONLINE on the Android client for ever - unless the background service is killed and the app restarted on the Android device.
I find that if DHT proxy is disabled in the client, everything works reasonably OK. Android clients go offline after 5 minutes and Desktop clients after 10 minutes. I will close this, I will reopen it if I am able to reproduce the problem with more details.