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

Popup notification for the same historical message each time I view the room in a fresh session

Open Half-Shot opened this issue 7 months ago • 2 comments

Steps to reproduce

  1. Open Element Desktop
  2. Review rooms as normal
  3. Eventually some time later open one specific room
  4. See a notification for a (threaded, with mention) message from a month ago
  5. This repeats each time I do these steps, it does not resend if I go out and back into the room within the same session.

Outcome

What did you expect?

Messages should only ever notify me once, and ideally never if they are old messages.

What happened instead?

I am being repeatedly notified for the same message

Operating system

Arch Linux

Application version

Element Nightly version: 2025051601 Crypto version: Rust SDK 0.11.0 (f2e32d4), Vodozemac 0.9.0

How did you install the app?

pacman

Homeserver

half-shot.uk

Will you send logs?

Yes

Half-Shot avatar May 19 '25 07:05 Half-Shot

Debugging:

  • This fires via the onEventDecrypted handler (https://github.com/vector-im/riot-web/blob/aa821a5b6fbe291fafaf232849dd23e57a39a1e7/src/Notifier.ts#L416-L425)
  • This appears to fire as a side effect of the reply chain being evaluated
  • this.pendingEncryptedEventIds gates the decryption listener, so that only "recent" events are handled as this array is appended to by the onEvent handler.
  • IRoomTimelineData.liveEvent is set as true on this event from ages ago.

Call stack:

Image

Culprit:

Looks like addEventToTimeline sets liveEvent as true, which is because toStartOfTimeline is false, the timeline is the live timeline and the event was not from the cache.

Half-Shot avatar May 19 '25 07:05 Half-Shot

Good debugging: seems like the 'live' and 'to start' concepts have got confused: possibly it needs to be split out into its own param.

dbkr avatar Jun 18 '25 16:06 dbkr