element-hq / element-android

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

Double receiving notifications when using the desktop application #8629

Open scolastico opened 1 year ago

scolastico commented 1 year ago

Steps to reproduce

  1. install element desktop, log in and launch it.
  2. Install element android, log in and put the phone in standby mode.
  3. start a chat with someone via element desktop.

Outcome

What did you expect?

No notification on my phone because I have Element Desktop open and thus marked as online.

What happened instead?

My phone makes a notification for any message, which is very annoying.

Your phone model

Samsung S8+

Operating system version

Android 12 / Lineage OS 19 / lineage_dram2lte-userdebug

Application version and app store

1.6.5 google play

Homeserver

Synapse 1.89.0

Will you send logs?

No

Are you willing to provide a PR?

No

xxfogs commented 4 months ago

I am unsure if this is all that tolerable after a while...

Are there any plans to solve this?

kolorafa commented 2 weeks ago

Confirmed.

IMHO on devices that are not the "last used device", the notification should be delayed by 2-5s allowing for read recipient to be delivered from other sessions, and it should only notify if no read recipient arrive in set time.

Initially the delay could be configured or to be enabled/disabled.

If I send message while actively hitting keyboard on receiving client - it's fine, no notifications (or they almost instantly disappear). If I leave the window open but without any actions (like waiting for the person reply) for even 30s?, then all devices get instant notifications - which is annoying.

Yes, there is still around 1s delay, first I get notification on desktop, then one second later on mobile, and then few seconds later I see that this message is flagged as "read" on the sender chat and the notification disappeared.

So It works, and it's removing already read notifications but definitely need way bigger delay.