element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
GNU Affero General Public License v3.0
3.39k stars 731 forks source link

Notification LED blinks only once on notifications #4651

Open ASoTNetworks opened 2 years ago

ASoTNetworks commented 2 years ago

Steps to reproduce

  1. Enable LED blink in notification settings for both noisy and silent in Android notification settings.

Outcome

What did you expect?

LED should stay blinking based on Android settings until notification is read or cleared

What happened instead?

LED only blinks once and stays off but notification is still in the status bar.

Your phone model

OnePlus One

Operating system version

Android 11

Application version and app store

Element version 1.3.4, olm version 3.2.4 from Google Play

Homeserver

No response

Will you send logs?

No

ouchadam commented 2 years ago

this seems to be caused by setOnlyAlertOnce https://github.com/vector-im/element-android/blob/develop/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt#L855

brevilo commented 2 years ago

this seems to be caused by setOnlyAlertOnce https://github.com/vector-im/element-android/blob/develop/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt#L855

If that comment is correct, then it's unlikely to be that specific line since the OP uses Android 11. But yes, it might be a regression of #3786.

To add another data point: I also have a similar issue where the LED doesn't blink at all (or maybe once so briefly I don't see it) after receiving a notification (sound and pop-up are fine). When I use Element's built-in notification test, though, everything behaves normal, so it's unlikely to be an Android (notification setup) issue. Just an idea: this effects encrypted messages so maybe the notification update (via sync) after the initial FCM notification disables the LED again...?

Using Android 11 and Element 1.3.15 (Play Store).

ASoTNetworks commented 2 years ago

Still having the same issue on 1.3.15 and if I leave the app open (in foreground) the LED stays blinking normally.

brevilo commented 2 years ago

To add another data point: I also have a similar issue where the LED doesn't blink at all (or maybe once so briefly I don't see it) after receiving a notification (sound and pop-up are fine).

Update: further testing showed that this affected a single DM "room" only. I couldn't reproduce it with new DMs or rooms, so I just left the old DM and created a new one. What do you know, it works fine now. No idea how to track that down, so I'll leave it at that. 🤷‍♂️

ASoTNetworks commented 2 years ago

For me it happens to both new and old rooms / DMs