Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android app should alert when connection is lost and it's attempting to reconnect to the server #1101

Open
milosivanovic opened this issue Apr 29, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@milosivanovic
Copy link

馃挕 Idea
I have experienced some rare scenarios (e.g. on in-flight wifi or in places where mobile coverage is very spotty) that the ntfy mobile app client (specifically Android) may struggle to regain a websocket connection with the server. When this happens, there's no alert in the app that the connection to the server was dropped and that new notifications won't arrive. The only way to know is if you open the ntfy app perchance and notice the subscription subtext silently added a status to the notification count, showing "99 notifications, reconnecting..." instead of just "99 notifications".

The scenario doesn't actually have to be rare or unusual - other ways this could happen is if the ntfy server does gown (power outage, network issues) or the user's Internet connection goes down, or any combination of network reasons that might interrupt the websocket connection in the mobile app. Connections drop for normal reasons too (e.g. when the phone is switching from cellular to wifi and vice-versa) and in these cases the client is expected to reconnect without issue within a quick timeframe, but as I've experienced, it's possible that it may take an extended time to regain connectivity, or may get stuck. During this time, critical notifications would be missed until the connection is re-established. The user would have no idea.

Because some drops/reconnects are part of the normal lifecycle, I don't think a blanket solution to alert every disconnection is the right one. But if a connection attempt takes longer than some set interval, like 1 minute, the app should emit a notification and/or persistent notification that it's currently attempting to regain connectivity. This interval and whether it's a persistent notification or not could be a setting for the user to decide on.

Having this alert would give users peace of mind that they'll be made aware if the connection goes down and can monitor or take action to restore it.

馃捇 Target components
Android/iOS app

@milosivanovic milosivanovic added the enhancement New feature or request label Apr 29, 2024
@windowsrefund
Copy link

This would be useful for those of us running the server as well. I recently had an issue with nginx crashing which meant no traffic was able to get to ntfy. Having the client (already running on my phone) generate a notification when it can't connect to the server (after a reasonable number of retries) would be the low-hanging fruit solution here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants