element-android icon indicating copy to clipboard operation
element-android copied to clipboard

Chats no longer refresh since recent update, requires "backing out" or force close to refresh

Open binarydad opened this issue 2 years ago • 48 comments

Since around 1.5.12 I believe (at least 1.5.14), I've noticed that when I open the app, the chats no longer refresh, and I'm seeing old messages from the last time I used the app. I have to "back out", force close, or clear the cache (in Settings) for it to work again. Only then does the "rolling" green loading indicator cycle along the top of the chats and they begin refreshing. Still, even after this, when I open the app again later on, it has not refreshed since that time. I'm currently using 1.5.18 and the issue is still there.

I am not seeing this on the desktop/web clients.

I'm using Synapse 1.74 on Ubuntu. The device is Android 13 on a Galaxy S22. Thanks!

binarydad avatar Jan 02 '23 20:01 binarydad

Hi, thanks for the feedback @binarydad . It looks like your app is not syncing when in background (and even when in foreground, which is more concerning). At first check, can you navigate to Settings/Notifications/Troubleshoot Notification and see what's happening there?

bmarty avatar Jan 02 '23 20:01 bmarty

This happened to me as well, starting from 1.5.14 (1.5.13 worked fine).

q234rty avatar Jan 03 '23 19:01 q234rty

I believe the sync related change in 1.5.14 caused the app to not try to sync at all in certain cases, but not sure.

q234rty avatar Jan 03 '23 19:01 q234rty

My check of the notifications was fine. I did notice, however, that after clearing cache again, it seems to be "keeping up" with the state when comparing it to the desktop app. I'll monitor it and report back if it starts falling behind in terms of chat state/messages.

EDIT: oops, posted from my other GH account. ryanpeters-MSFT = binarydad

ryanpeters-MSFT avatar Jan 03 '23 19:01 ryanpeters-MSFT

Update since last time... it seems oddly intermittent. About 80% of the time, going back into the app, I immediately see the green bar sliding/loading across the top, and chats refresh. However, I just now went back into the app and it still had chat state from very early this morning (backing out of the app and re-opening caused them to refresh).

Still, this was almost never a problem before some of the recent updates (not sure which one).

How can I assist with this further? Thanks!

binarydad avatar Jan 06 '23 20:01 binarydad

In my experience this only happens if you leave the app in the background long enough and then go back to the app.

q234rty avatar Jan 06 '23 21:01 q234rty

Understood. Either way, it's a new (only slightly annoying) behavior.

binarydad avatar Jan 06 '23 21:01 binarydad

Hi, thanks for the feedback @binarydad . It looks like your app is not syncing when in background (and even when in foreground, which is more concerning). At first check, can you navigate to Settings/Notifications/Troubleshoot Notification and see what's happening there?

FYI, still happening - I'll open the app and I only see messages from the day before, until I back out of the app. Is there anything else I can try or give additional information? Thanks.

binarydad avatar Jan 09 '23 18:01 binarydad

Would the PR (https://github.com/vector-im/element-android/pull/7724) possibly address this issue?

binarydad avatar Jan 10 '23 16:01 binarydad

Sorry for being noisy. Still having the same behavior.

binarydad avatar Jan 11 '23 20:01 binarydad

Another confirmation of this behaviour., though slightly different. In my case, it also affects incoming push notifications. Those do not come in at all until I open the app and it refreshes. But the app does refresh itself once opened within a few seconds.

Troubleshooting notifications hangs during the "Test Push" stage. Confirming on my homeserver that nothing comes in beyond the earlier test that hits the pushers endpoint.

Jan 16 10:01:35 synapse matrix-synapse[3320551]: 2023-01-16 10:01:35,525 - synapse.access.http.8008 - 460 - INFO - GET-8 - ::ffff:x.x.x.x - 8008 - {@joshuaboniface:bonifacelabs.ca} Processed request: 0.023sec/0.001sec (0.005sec, 0.002sec) (0.002sec/0.016sec/3) 344B 200 "GET /_matrix/client/r0/pushers HTTP/1.1" "Element/1.5.20 (samsung SM-G970W; Android 12; SP1A.210812.016.G970WVLS8IVK2; Flavour GooglePlay; MatrixAndroidSdk2 1.5.20)" [0 dbevts]

This was tested with push integrated into the main process as a test; I switched back to the dedicated pusher worker, and then if I have someone send a real push, my pusher worker just shows:

Jan 16 10:15:22 synapse matrix-synapse-pusher[3324368]: 2023-01-16 10:15:22,122 - synapse.push.httppusher - 225 - INFO - httppush.process-18 - Processing 1 unprocessed push actions for @joshuaboniface:bonifacelabs.ca/im.vector.app.android/xxx:xxx-xxx starting at stream_ordering 10084081
Jan 16 10:15:22 synapse matrix-synapse-pusher[3324368]: 2023-01-16 10:15:22,387 - synapse.http.client - 460 - INFO - httppush.process-18 - Received response to POST https://matrix.org/_matrix/push/v1/notify: 200           

I can't tell for certain if this is something wrong with the homeserver, or something wrong with the mobile client, but it's quite annoying in either case.

Worth noting that this affects myself on Android, but does not seem to affect other users on iOS, nor users on the desktop clients.

joshuaboniface avatar Jan 16 '23 15:01 joshuaboniface

Another confirmation of this behaviour., though slightly different. In my case, it also affects incoming push notifications. Those do not come in at all until I open the app and it refreshes. But the app does refresh itself once opened within a few seconds.

Troubleshooting notifications hangs during the "Test Push" stage. Confirming on my homeserver that nothing comes in beyond the earlier test that hits the pushers endpoint.

Jan 16 10:01:35 synapse matrix-synapse[3320551]: 2023-01-16 10:01:35,525 - synapse.access.http.8008 - 460 - INFO - GET-8 - ::ffff:x.x.x.x - 8008 - {@joshuaboniface:bonifacelabs.ca} Processed request: 0.023sec/0.001sec (0.005sec, 0.002sec) (0.002sec/0.016sec/3) 344B 200 "GET /_matrix/client/r0/pushers HTTP/1.1" "Element/1.5.20 (samsung SM-G970W; Android 12; SP1A.210812.016.G970WVLS8IVK2; Flavour GooglePlay; MatrixAndroidSdk2 1.5.20)" [0 dbevts]

This was tested with push integrated into the main process as a test; I switched back to the dedicated pusher worker, and then if I have someone send a real push, my pusher worker just shows:

Jan 16 10:15:22 synapse matrix-synapse-pusher[3324368]: 2023-01-16 10:15:22,122 - synapse.push.httppusher - 225 - INFO - httppush.process-18 - Processing 1 unprocessed push actions for @joshuaboniface:bonifacelabs.ca/im.vector.app.android/xxx:xxx-xxx starting at stream_ordering 10084081
Jan 16 10:15:22 synapse matrix-synapse-pusher[3324368]: 2023-01-16 10:15:22,387 - synapse.http.client - 460 - INFO - httppush.process-18 - Received response to POST https://matrix.org/_matrix/push/v1/notify: 200           

I can't tell for certain if this is something wrong with the homeserver, or something wrong with the mobile client, but it's quite annoying in either case.

Worth noting that this affects myself on Android, but does not seem to affect other users on iOS, nor users on the desktop clients.

Same here as well. After noticing it didn't refresh, I tested sending a message to myself from my son's phone to see if I was at least receiving notifications in some fashion, but they did not come (they were received fine on web/desktop). And as @joshuaboniface mentioned, after backing out and letting the app refresh, it all works again. It's something being idle after a while when it seems to emit the behavior.

BTW I'm using NTFY, but don't believe the overall behavior is related to the push handler.

binarydad avatar Jan 23 '23 14:01 binarydad

I was waiting to get 1.5.20 on F-Droid before commenting. If you remove the app from Recents, then sync works fine. But if you merely Back out of Element to the home screen or another app, then upon resuming the app the Sync thread state changes to Idle... permanently. The only way to fix it is to remove the app from Recents again. Waiting for it to resolve itself never works.

Sometimes, quickly opening a chat upon resuming causes the sync state to become normal again, but not always.

opusforlife2 avatar Jan 27 '23 21:01 opusforlife2

I'm running 1.5.22 and it is not yet fixed.

------ Original Message ------ From "opusforlife2" @.> To "vector-im/element-android" @.> Cc "Ryan Peters" @.>; "Mention" @.> Date 1/27/2023 4:14:24 PM Subject Re: [vector-im/element-android] Chats no longer refresh since recent update, requires "backing out" or force close to refresh (Issue #7876)

I was waiting to get 1.5.20 on F-Droid before commenting. If you remove the app from Recents, then sync works fine. But if you merely Back out of Element to the home screen or another app, then upon resuming the app the Sync thread state changes to Idle... permanently. The only way to fix it is to remove the app from Recents again. Waiting for it to resolve itself never works.

Sometimes, quickly opening a chat upon resuming causes the sync state to become normal again, but not always.

— Reply to this email directly, view it on GitHub https://github.com/vector-im/element-android/issues/7876#issuecomment-1407080982, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANN2X6T2CSP4ZZSQ35CFG3WUQ3DBANCNFSM6AAAAAATPCN3HQ. You are receiving this because you were mentioned.Message ID: @.***>

binarydad avatar Jan 27 '23 21:01 binarydad

I'm still having this too. It's very annoying because even though notifications come in, the history shown in Element is stale. The sync thread just stays on idle. I have to force kill the app to make it work again but it will go back to idle after a while and then it remains dead. I was using the normal Google firebase cloud messaging by the way, not ntfy.. I have Google play installed but am not logged into it. This is not normally a problem for push.

I've found a workaround: using the F-droid version of element which doesn't use push. That keeps the sync thread alive somehow. But it absolutely kills my battery life because it constantly has to sync in the background. I see in this thread that others have discovered this workaround as well.

This is on Android 13 by the way. If you need any info or logs please let me know.

Edit: Sorry for the double comment. Thought I was editing.

Tycho-S avatar Feb 09 '23 17:02 Tycho-S

Same here, SyncThread changes to idle. Also I don't always get timely notifications or voice calls, although that might be because of MIUI (another friend with MIUI can confirm as well). It's not reliable for 1:1 communications as these sometimes are urgent. I sent some rageshakes with the "Not syncing" description.

z411 avatar Feb 10 '23 17:02 z411

I've tried reverting to 1.5.13 and it seems to have resolved the issue. I think there is merit in what @q234rty suggested, that the hotfix in 1.5.14 ( https://github.com/vector-im/element-android/pull/7827 ) is causing this. It seems to be causing an edge case that stops the sync thread from continuing after a while.

Tycho-S avatar Feb 10 '23 17:02 Tycho-S

I've noticed this might be fixed in 1.5.24. Maybe with this commit? https://github.com/vector-im/element-android/pull/8019

binarydad avatar Feb 10 '23 17:02 binarydad

I just hit the bug again on 1.5.22 - I'll try 1.5.24 now.

z411 avatar Feb 10 '23 19:02 z411

Still having this issue on 1.5.24 as well. For fun I decided to also change the power management setting on the app (just in case it was Android backgrounding it) to Unrestricted, and this makes no difference either.

joshuaboniface avatar Feb 11 '23 23:02 joshuaboniface

Interesting. I have yet to see it and I think I would have by now.

binarydad avatar Feb 12 '23 01:02 binarydad

I think it's not showing the bug for some people because some phones kill the app in the background a lot. For me it often takes a day or two to manifest. If the app never runs that long it might not happen.

Tycho-S avatar Feb 12 '23 14:02 Tycho-S

Nah, before the problematic version, Element used to run just fine for days on end without bugging out this way.

opusforlife2 avatar Feb 12 '23 14:02 opusforlife2

@opusforlife2 I meant that this is perhaps why it might not manifest itself for some people like @binarydad . I'm also seeing the problem myself and I agree with you that it never happened before 1.5.14. I reverted to 1.5.13 and it also hasn't happened anymore.

Tycho-S avatar Feb 12 '23 14:02 Tycho-S

Same problem here 1.5.22, no E2E, homeserver, Android 13 (Galaxy S20) Terrible bug let's face it

cpot avatar Feb 12 '23 23:02 cpot

It hasn't happened to me since I updated to 1.5.24 but it might be coincidence.

z411 avatar Feb 16 '23 16:02 z411

Tentatively considering it fixed as of 1.5.25. I was able to get "Idle" for the Sync thread by backing out and resuming the app, but only once in many tries.

Some new behaviour has come up, though. Immediately backing out and resuming the app now frequently changes the "Sync request" status to "Unknown". Never seen that before. This then sometimes automatically resolves itself and goes back to "Idle". But sometimes it doesn't, and stays as Unknown. The messages still come through though, and then it changes back to "Idle".

opusforlife2 avatar Feb 22 '23 15:02 opusforlife2

Yeah my SO is having very frequent problems every few days of just not receiving my messages, until they force stop and relaunch the app. As soon as they do, they get my messages. This really is a new bug, but it is unclear when it started.

BloodyIron avatar Feb 27 '23 02:02 BloodyIron

Update: after several weeks, and using 1.5.26 as well, I'm still getting an "Idle" Sync thread once or twice a day. It's low enough not to be a bother, but it means that the underlying problem hasn't been fully fixed.

opusforlife2 avatar Mar 12 '23 18:03 opusforlife2

It's still broken for me too. Still happens a lot in fact. Perhaps it has to do with the fact that my instance isn't publicly reachable. I connect via VPN. I guess this has to do with why this bug manifests itself more often for me.

1.5.13 is working perfectly though. So I've stayed on that. I'm pretty sure the hotfix https://github.com/vector-im/element-android/pull/7827 caused an edge case because it's the only thing that changed in 1.5.14. And it was explicitly to do with the sync thread.

I've stopped testing new versions regularly now. Because I don't think anyone is looking at this issue. But I'm very happy to test it if I can help.

For me it's very bothersome because it causes me to miss urgent messages. The notification still comes in when push is enabled but I don't see them in the app then. So when someone replies while I'm in the app I don't see it.

Tycho-S avatar Mar 12 '23 19:03 Tycho-S