element-hq / riot-android

A glossy Matrix collaboration client for Android
Apache License 2.0
1.41k stars 396 forks source link

When Riot client isn't connected but is running, user isn't notified #1591

Open Porkepix opened 6 years ago

Porkepix commented 6 years ago

Due to another bug I need to investigate, my Riot client is running on my Android phone, but fail to establish a connection when I'm on my home wifi. That's especially visible with the perpetual loading bar at the top of the interface, or by failing messages on the login view if I disconnect myself of the application.

The problem is that when that happen, nothing tells to the user he's actually disconnected: no notification, and the bar in the notification tray is still displaying "Listening for events", which lead to the wong belief that application is still running perfectly normally.

By the way, when speaking about that bar in the notification tray, I would suggest to change the wording. While "Listening for events" can be understand by someone with network and programming notions, this is probably very hard to understand what does that mean for "normal users".

ylecollen commented 6 years ago

@Porkepix Could you send a bug report ? It looks like the GCM registration failed. if the GCM registration failed, the "listen for events" is the fallback ie the application performs background syncs with a customised period. It should never happen for the google play users.

Porkepix commented 6 years ago

Okay, forgot to add here that I'm using the F-droid version, not the Google Play one. So that bug might only concern non-Google Play Store versions, I don't know if it's the case in this one either.

ylecollen commented 6 years ago

@Porkepix There was something similar on IOS (the header was red to warn of the connection issue). How do you expect to be warned ? Which message would like to have instead of "Listen for events" ?

Porkepix commented 6 years ago

Well "Listen to events" can only be understood by technical persons imho. Replace it by "connected" or anything simple like that. A color could be good either, but I'm not sure Android allows that. And, most importantly, having at least a notification in the system tray informing the user when it's disconnecting (with some tolerance, so that user isn't spammed). You can take as example how does conversations.im works as a XMPP client.

ylecollen commented 6 years ago

@Porkepix I'm not a conversations.im user. Could you summarise me how it shows that you are connected or not.

Porkepix commented 6 years ago

Well, in conversations.im's case there's no permanent notification telling this is running, but there's one appearing when an account fail to (re)connect to the server. But it's perfectly possible to keep the permanent notification, change the wording and have it state it failed to (re)connect while notifying the user in case of such problem.

ylecollen commented 6 years ago

We have to keep the permanent notification but we use a foreground service. So, you would like that the content is modified by the network connectivity ? it makes sense

Porkepix commented 6 years ago

Why is the need for the permanent notification?

ylecollen commented 6 years ago

because Android forces to display it https://developer.android.com/guide/components/services.html#Foreground

. For this reason, foreground services must show a status bar notification with a priority of PRIORITY_LOW or higher

Porkepix commented 6 years ago

Then I'm wondering why other messaging clients don't need to do so… Either way if this isn't in question, there should then have a different text, maybe color change and a second active notification so that the user is aware he can't receive messages anymore if someone try to communicate with him.