6
61
Fork
You've already forked android
5

after reconnecting the device to the internet, it takes Sunup (up to) several minutes to recognize it (if at all) #14

Closed
opened 2025年02月15日 21:24:18 +01:00 by DJCrashdummy · 21 comments
Contributor
Copy link

i'm testing the Sunup Android app (fdroid build version 1.0.2 with default settings/server) for the last week or so and it seems to work fine. 👍
...except one thing: if the device gets disconnected from the internet the disconnect notification pops up immediately, but after the device gets reconnected it takes Sunup up to several minutes to recognize it and the disconnected notification to disappear.

on the same device at the same time other apps depending on a network connection (also with a notification) - like Syncthing - notice the reconnection immediately.


i attached the logs starting right before deactivating the Wi-Fi at ~13:35. at ~13:38 i activated the Wi-Fi again but Sunup does nothing at all. and finally at 13:40:30 the disconnected notification disappeared.

i'm testing the Sunup Android app (fdroid build version 1.0.2 with default settings/server) for the last week or so and it seems to work fine. 👍 ...except one thing: if the device gets disconnected from the internet the disconnect notification pops up immediately, but after the device gets reconnected it takes Sunup up to several minutes to recognize it and the disconnected notification to disappear. on the same device at the same time other apps depending on a network connection (also with a notification) - like Syncthing - notice the reconnection immediately. --- i attached the logs starting right before deactivating the Wi-Fi at ~13:35. at ~13:38 i activated the Wi-Fi again but Sunup does nothing at all. and finally at 13:40:30 the disconnected notification disappeared.
Author
Contributor
Copy link

unfortunately i have to report that today i had to experience that the disconnect notification stayed there for about 10-15 minutes after reconnection although i was connected to the internet (and received the messages within the app itself, but still Sunup showed its disconnected notification). 😏
after that i opened Sunup and tapped "Restart Service", which i guess is more or less equal to a force reconnect.

(削除) i'll have an eye on it if it happens again... and if so, perhaps i even manage to gather a log. (削除ここまで)


UPDATE: sadly i had to notice that this happens every now and then... it seems after being offline for a longer time (a few hours or more).
so FWIW i also started to fetch a log (attached to this post) after noticing Sunup won't reconnect: i tapped on the notification to open the app and ~30s later i used "Restart Service" to get it working again.

unfortunately i have to report that today i had to experience that the disconnect notification stayed there for about 10-15 minutes after reconnection although i was connected to the internet (and received the messages within the app itself, but still Sunup showed its disconnected notification). 😏 after that i opened Sunup and tapped "Restart Service", which i guess is more or less equal to a force reconnect. ~~i'll have an eye on it if it happens again... and if so, perhaps i even manage to gather a log.~~ --- UPDATE: sadly i had to notice that this happens every now and then... it seems after being offline for a longer time (a few hours or more). so FWIW i also started to fetch a log (attached to this post) after noticing Sunup won't reconnect: i tapped on the notification to open the app and ~30s later i used "Restart Service" to get it working again.
DJCrashdummy changed title from (削除) after reconnecting the device to the internet, it takes Sunup (up to) several minutes to recognize it (削除ここまで) to after reconnecting the device to the internet, it takes Sunup (up to) several minutes to recognize it (if at all) 2025年02月22日 07:06:45 +01:00
Owner
Copy link

Fixed in 1.0.3 !

Fixed in 1.0.3 !
Author
Contributor
Copy link

@s1m first i have to apologize: i'm sorry that i forgot to mention that i'm using a VPN on the device i took the logs from.


hmmm... unfortunately i have to report that things (with version 1.0.4 original/default build) got rather worse than better:

  • on a device without an active VPN it still takes up to several minutes for the disconnect notification to disappear (if it does at all).
  • in case of deactivating all network connections manually, the disconnected notification does not appear... which (defeats its purpose IMHO and) makes it impossible to tell if Sunup is working correctly after a reconnection.
  • on the device with an active VPN (although it is setup that Sunup bypasses it) i hardly or never get push notifications after reconnecting the device without manually restarting the service in Sunup.
  • and even worse: on the same device with the active VPN, the disconnected notification never shows up anymore!
    -> hence now i can't be sure anymore if there are just no notifications or if Sunup is not working correctly and i have to restart it manually every time to be on the safe side.

to overuse my comparison with Syncthing once more:
on the device with a VPN it is also configured to bypass the VPN and even on a device without an active VPN, it behaves exactly the same (depending on the settings in Syncthing): the second a network connection is established, Syncthing wakes up and tries to reach other devices; the second it loses the network connection (no mater why), it goes to sleep.

@s1m first i have to apologize: i'm sorry that i forgot to mention that i'm using a VPN on the device i took the logs from. --- hmmm... unfortunately i have to report that things (with version 1.0.4 original/default build) got rather worse than better: - on a device without an active VPN it still takes up to several minutes for the disconnect notification to disappear (if it does at all). - in case of deactivating all network connections manually, the disconnected notification does not appear... which (defeats its purpose IMHO and) makes it impossible to tell if Sunup is working correctly after a reconnection. <!-- break list --> - on the device with an active VPN (although it is setup that Sunup bypasses it) i hardly or never get push notifications after reconnecting the device without manually restarting the service in Sunup. - and **even worse**: on the same device with the active VPN, the disconnected notification never shows up anymore! -> hence now **i can't be sure anymore if there are just no notifications or if Sunup is not working correctly** and i have to restart it manually every time to be on the safe side. to overuse my comparison with Syncthing once more: on the device with a VPN it is also configured to bypass the VPN and even on a device without an active VPN, it behaves exactly the same (depending on the settings in Syncthing): the second a network connection is established, Syncthing wakes up and tries to reach other devices; the second it loses the network connection (no mater why), it goes to sleep.
Owner
Copy link

If you want to do some tests, tap 5 times on "Registered applications", you will see if the service is correctly started. And if you want to check if you are able to receive notifications, install UP-Example, and send a test notification

The notification is here to inform if the service is unavailable when you have network. When there is no network, it doesn't show a notification. This is on purpose, to not spam when the user set airplane mode. And because you obviously don't have a connection without network

If you want to do some tests, tap 5 times on "Registered applications", you will see if the service is correctly started. And if you want to check if you are able to receive notifications, install UP-Example, and send a test notification The notification is here to inform if the service is unavailable when you have network. When there is no network, it doesn't show a notification. This is on purpose, to not spam when the user set airplane mode. And because you obviously don't have a connection without network
Owner
Copy link

Could you do your tests (with UP-Example) before re-opening the issue ?

Could you do your tests (with UP-Example) before re-opening the issue ?
Author
Contributor
Copy link

i guessed something like that... which is ok IMHO but makes things more complicated.
...especially as long as it does not work reliable in conjunction with an active VPN or still takes ages to reconnect resp. fetch push notifications and hence makes it even harder to tell if it either works correctly, you still have to wait a little to get your notifications or if you have to take action manually to make thinks work again.


Could you do your tests (with UP-Example) before re-opening the issue ?

ok... will do.

i guessed something like that... which is ok IMHO but makes things more complicated. ...especially as long as it does not work reliable in conjunction with an active VPN or still takes ages to reconnect resp. fetch push notifications and hence makes it even harder to tell if it either works correctly, you still have to wait a little to get your notifications or if you have to take action manually to make thinks work again. --- > Could you do your tests (with UP-Example) before re-opening the issue ? ok... will do.
Owner
Copy link

It may have been a confusion on how it was supposed to work. I do have a VPN and it works as intended. But if you do your tests and we are sure there is another bug, we'll find it :)

It may have been a confusion on how it was supposed to work. I do have a VPN and it works as intended. But if you do your tests and we are sure there is another bug, we'll find it :)
Owner
Copy link

And if you do your tests and it ends up working as intended, let me know too please !

And if you do your tests and it ends up working as intended, let me know too please !
Author
Contributor
Copy link

ok, i started "fresh"... uninstalled & reinstalled UP-example & Sunup, gone back in Element to google (no VPN device) resp. background sync (device with VPN) and also reverted the exceptions at the firewall/VPN as - according to you - it should work no mater what.

  1. i opened Sunup at least once and made sure it is exempted from doze.
  2. i opened Element and tried to switch the notification/push service to Sunup (for sure while having a network connection with internet).
    • on the device without an active VPN it worked and also checking in Sunup showed Element as registered application.
    • on the device with an active VPN it showed "Cannot register Element, no internet." in a toast message and hence also doesn't show up in Sunup.
  3. so i tried to confirm it via UP-Example... and it was exactly the same: on the device without the VPN, registering worked as intended, but with the VPN it showed "Cannot register UP-Example, no internet.".
  4. and now it gets even "better":
    • FWIW i tried to register ntfy as push service in Element. and it worked on both devices (i've checked via ntfy app that they were really registered).
    • but even after that, when trying to register UP-Example or Sunup on the device with the VPN, i still get the toast message "Cannot register XYZ, no internet.".

from my limited understandig, this seems to be a different issue in conjunction with VPNs, than i/we initially thought... so reopen this issue or open a new one?

ok, i started "fresh"... uninstalled & reinstalled UP-example & Sunup, gone back in Element to google (no VPN device) resp. background sync (device with VPN) and also reverted the exceptions at the firewall/VPN as - according to you - it should work no mater what. 1. i opened Sunup at least once and made sure it is exempted from doze. 2. i opened Element and tried to switch the notification/push service to Sunup (for sure while having a network connection with internet). - on the device without an active VPN it worked and also checking in Sunup showed Element as registered application. - on the device with an active VPN it showed *"Cannot register Element, no internet."* in a toast message and hence also doesn't show up in Sunup. 3. so i tried to confirm it via UP-Example... and it was exactly the same: on the device without the VPN, registering worked as intended, but with the VPN it showed *"Cannot register UP-Example, no internet."*. 4. and now it gets even "better": - FWIW i tried to register ntfy as push service in Element. and it worked on both devices (i've checked via ntfy app that they were really registered). - **but** even after that, when trying to register UP-Example or Sunup on the device with the VPN, i still get the toast message *"Cannot register XYZ, no internet."*. --- from my limited understandig, this seems to be a different issue in conjunction with VPNs, than i/we initially thought... so reopen this issue or open a new one?
Author
Contributor
Copy link

just to mention it because i noticed it:
in Element when changing/registering a push service i can choose between Sunup, ntfy and google/background-sync. but when testing with UP-Example it seems to automatically assume Sunup... i would have expected to be asked which one of the installed UP-apps (ntfy & Sunup in my case) i want to use resp. test. ...or am i missing or misunderstanding something?

just to mention it because i noticed it: in Element when changing/registering a push service i can choose between Sunup, ntfy and google/background-sync. but when testing with UP-Example it seems to automatically assume Sunup... i would have expected to be asked which one of the installed UP-apps (ntfy & Sunup in my case) i want to use resp. test. ...or am i missing or misunderstanding something?
Owner
Copy link

There may be some inconsistency depending on the device. What is your device, OS, and version, what VPN and do you route all your traffic ?

UP-Example it seems to automatically assume Sunup

Yeah, ntfy don't follow the last specs, a PR is open for months

There may be some inconsistency depending on the device. What is your device, OS, and version, what VPN and do you route all your traffic ? > UP-Example it seems to automatically assume Sunup Yeah, ntfy don't follow the last specs, a PR is open for months
Author
Contributor
Copy link

UP-Example it seems to automatically assume Sunup

[...] ntfy don't follow the last specs [...]

ok... makes sense. thanks for clarifying.


  • device: Amazon Fire HD 10 (11. generation)
    • codename: trona
    • OS: Android 9
  • VPN/firewall: Rethink: DNS + Firewall + VPN
    i'm using a local VPN which is always on to block most of the Amazon crap phoning home or the like... so there are quite a bunch of the preinstalled apps blocked completely; most of the apps installed by me, go normally through the VPN (like all apps in the last test) and some apps which need access to the loacal network (like VNC, Syncthing etc.) are set to bypass the VPN.

damn... i'm afraid you are right, that this is some device inconsistency resp. Amazon BS! - i fired up an even older device (to rule out the old Android version) and even with Android 7.1 not matter if the VPN is active or not, it seems to work. 😒
-> but it is still crazy why ntfy works on the Amazon device with the VPN enabled and Sunup (and UP-Example) doesn't. 🤨 ...but that's maybe also related to the different specs they are using...?

> UP-Example it seems to automatically assume Sunup >> [...] ntfy don't follow the last specs [...] ok... makes sense. thanks for clarifying. --- - device: Amazon Fire HD 10 (11. generation) - codename: trona - OS: Android 9 - VPN/firewall: [Rethink: DNS + Firewall + VPN](https://f-droid.org/de/packages/com.celzero.bravedns/) i'm using a local VPN which is always on to block most of the Amazon crap phoning home or the like... so there are quite a bunch of the preinstalled apps blocked completely; most of the apps installed by me, go normally through the VPN (like all apps in the last test) and some apps which need access to the loacal network (like VNC, Syncthing etc.) are set to bypass the VPN. damn... i'm afraid you are right, that this is some device inconsistency resp. Amazon BS! - i fired up an even older device (to rule out the old Android version) and even with Android 7.1 not matter if the VPN is active or not, it seems to work. 😒 -> but it is still crazy why ntfy works on the Amazon device with the VPN enabled and Sunup (and UP-Example) doesn't. 🤨 ...but that's maybe also related to the different specs they are using...?
Owner
Copy link

but it is still crazy why ntfy works on the Amazon device with the VPN enabled and Sunup (and UP-Example) doesn't. 🤨 ...but that's maybe also related to the different specs they are using...?

Sunup doesn't try to reconnect if there is no internet, and on your device the checks always conclue there is no internet. I'll look how to improve this. Will you be OK to test once I'm on it ?

> but it is still crazy why ntfy works on the Amazon device with the VPN enabled and Sunup (and UP-Example) doesn't. 🤨 ...but that's maybe also related to the different specs they are using...? Sunup doesn't try to reconnect if there is no internet, and on your device the checks always conclue there is no internet. I'll look how to improve this. Will you be OK to test once I'm on it ?
Author
Contributor
Copy link

Will you be OK to test once I'm on it ?

yes, sure!
i was afraid that this will be closed with no solution as unfortunate corner case with a sh...iny device. 😬 ...but as i still want to switch to Sunup for all apps and devices i would have tested things nevertheless every now and then. hence i will happily test possible solutions to contribute at least in this way.

in advance to be on the safe side: depending on how much work it is, it may sometimes take a few days or week until i have time.


[...] ntfy works on the Amazon device with the VPN enabled and Sunup (and UP-Example) doesn't.

Sunup doesn't try to reconnect if there is no internet [...]

stupid question: why?
it seems that ntfy is a more or less mature project and works in most situations (resp. at least in more then Sunup)... so it might be worth taking some bits from it. - yes... i know, with every addition the complexity of the project/code ascends, so i'm not talking about completely copying ntfy or the network detection of Syncthing or the like, just borrowing ideas for the essential parts.

> Will you be OK to test once I'm on it ? yes, sure! i was afraid that this will be closed with no solution as unfortunate corner case with a sh...iny device. 😬 ...but as i still want to switch to Sunup for all apps and devices i would have tested things nevertheless every now and then. hence i will happily test possible solutions to contribute at least in this way. *in advance to be on the safe side: depending on how much work it is, it may sometimes take a few days or week until i have time.* --- > > [...] ntfy works on the Amazon device with the VPN enabled and Sunup (and UP-Example) doesn't. > > Sunup doesn't try to reconnect if there is no internet [...] stupid question: why? it seems that ntfy is a more or less mature project and works in most situations (resp. at least in more then Sunup)... so it might be worth taking some bits from it. - yes... i know, with every addition the complexity of the project/code ascends, so i'm not talking about completely copying ntfy or the network detection of Syncthing or the like, just borrowing ideas for the essential parts.
Owner
Copy link

stupid question: why?

[If it was consistent] Why would we try to do a request if we know there is no internet ?

> stupid question: why? [If it was consistent] Why would we try to do a request if we know there is no internet ?
Author
Contributor
Copy link

if "your if" would be correct, you are right. 😜

if "your if" would be correct, you are right. 😜
Author
Contributor
Copy link

found some inconsistencies related to this online/offline (detection resp. notification) topic:

The notification is here to inform if the service is unavailable when you have network. When there is no network, it doesn't show a notification. This is on purpose, to not spam when the user set airplane mode. And because you obviously don't have a connection without network

  • as soon as i loose the connection first, and then go offline or in airplane mode on purpose, the notification styes there. this is not a big deal, but somehow confusing because in one case it is shown while you are offline and in another case it is not. 😕
  • in a complete different case (when i disconnected on purpose and the notification didn't show up, as intended), when reconnecting to a network which prevents Sunup from connecting to the server the disconnected notification does not show up at all!

somehow i keep thinking that it may be better to show the disconnected notification no matter why there is no connection. - this would make the code simpler and the app easier to understand as there are no ifs and whys. someone who is bugged by this notification can hide it via Android settings (like i plan to do it with the connected notification which bugs me more by far).
yes you are right, then the notification also won't show up if the connection fails because of something outside of the device. ...but which is mostly also outside of the area of influence of the user. 🤷 and then this is a decision every individual user takes actively by hiding it.
-> as you can read between the lines: i personally prefer in case of such critical things like push notifications rather simple reliable code and straight forward notifications (if there is no connecting to the server, the notification shows up, no matter what), than preventing a little bit inconvenience for some users which also don't work reliable in all circumstances. 😒

found some inconsistencies related to this online/offline (detection resp. notification) topic: > The notification is here to inform if the service is unavailable when you have network. When there is no network, it doesn't show a notification. This is on purpose, to not spam when the user set airplane mode. And because you obviously don't have a connection without network - as soon as i loose the connection first, and then go offline or in airplane mode on purpose, the notification styes there. this is not a big deal, but somehow confusing because in one case it is shown while you are offline and in another case it is not. 😕 - in a complete different case (when i disconnected on purpose and the notification didn't show up, as intended), when reconnecting to a network which prevents Sunup from connecting to the server the disconnected notification does not show up at all! somehow i keep thinking that it may be better to show the disconnected notification no matter why there is no connection. - this would make the code simpler and the app easier to understand as there are no ifs and whys. someone who is bugged by this notification can hide it via Android settings (like i plan to do it with the connected notification which bugs me more by far). yes you are right, then the notification also won't show up if the connection fails because of something outside of the device. ...but which is mostly also outside of the area of influence of the user. 🤷 and then this is a decision every individual user takes actively by hiding it. -> as you can read between the lines: i personally prefer in case of such critical things like push notifications rather simple reliable code and straight forward notifications (if there is no connecting to the server, the notification shows up, no matter what), than preventing a little bit inconvenience for some users which also don't work reliable in all circumstances. 😒
Owner
Copy link

OK, so there are 2 new issues. I think we should keep the behavior of the first case, if the service has been disconnected for an unknown reason, the notification should still be there when we go offline. But the 2nd case should raise the notification, can you open an issue for it ?

Not having the notification when the device don't have network was requested by a few users, and I think it makes sense to follow this

OK, so there are 2 new issues. I think we should keep the behavior of the first case, if the service has been disconnected for an unknown reason, the notification should still be there when we go offline. But the 2nd case should raise the notification, can you open an issue for it ? Not having the notification when the device don't have network was requested by a few users, and I think it makes sense to follow this
Owner
Copy link
Related issue: https://codeberg.org/NextPush/nextpush-android/issues/27#issuecomment-3755162
Owner
Copy link

Interestingly, there is the same issue on Signal/Molly: https://github.com/mollyim/mollyim-android/issues/468

Interestingly, there is the same issue on Signal/Molly: https://github.com/mollyim/mollyim-android/issues/468
Owner
Copy link

A version is being published with a fix, hopefully the last one ! Feel free to give feedback after you test it @DJCrashdummy

A version is being published with a fix, hopefully the last one ! Feel free to give feedback after you test it @DJCrashdummy
Sign in to join this conversation.
No Branch/Tag specified
main
1.2.3-rc1
1.2.2
1.2.1
1.2.0
1.1.0
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.2.2
0.2.1
0.2.0
0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Sunup/android#14
Reference in a new issue
Sunup/android
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?