Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix: prevent spurious notifications from indexer #4414

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

bwindels
Copy link
Contributor

Fixes element-hq/element-web#12659

The problem was that EventIndex using an event mapper from the js-sdk to decrypt and create MatrixEvent object, it was also causing Event.decrypted to be emitted on the client, triggering https://github.com/matrix-org/matrix-js-sdk/blob/1b8f6d173953ac49c3178456ecb587ccefeb0cd3/src/client.js#L353 to add push actions for e2ee events. The highlight count there should only be set if the event hasn't been read before, but Room.hasUserReadEvent assumes that the whole timeline between the m.read marker and the given event id is known, which is not the case for older events or even rooms of a previous room version, as the bug indicates. In this case hasUserReadEvent returns false and the hightlight count is set, causing the badge.

Ideally, we'd fill any gaps created by a limited sync and store them, and only from this create e2ee notifications. But right now we don't have a good way to do that. So the solution taken here is to further disconnect the EventIndex from everything else that listens to the js-sdk, and the disable remitting from the event to the client from events created in the indexer.

@bwindels bwindels changed the title Fix: disable reemitting on the client for events mapped from the indexer Fix: prevent spurious notifications from indexer Apr 15, 2020
@bwindels bwindels requested a review from a team April 15, 2020 16:34
@bwindels bwindels merged commit 09e247b into develop Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spurious notification badges slowly appear on signing into Riot Desktop
2 participants