fix: prevent phantom badges in bridged rooms#2588
Open
andrewmurphyio wants to merge 1 commit intocinnyapp:devfrom
Open
fix: prevent phantom badges in bridged rooms#2588andrewmurphyio wants to merge 1 commit intocinnyapp:devfrom
andrewmurphyio wants to merge 1 commit intocinnyapp:devfrom
Conversation
When using bridged rooms (e.g., Slack bridge), read receipts may not sync back to Matrix. This causes roomHaveUnread() to return true even when the server notification count is 0. Now we only add a room to the unread list if the server actually reports notifications (total > 0 or highlight > 0). This makes the server notification count authoritative and prevents phantom badges.
|
I've been testing this for a week, and it fixes the issue on a single client. Sadly, when using multiple devices (Desktop and a phone for example), ghost notifications for things read on one device appear on the other device. I'm not sure if this is easily fixable, though. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2589
Fixes phantom unread badges appearing in bridged rooms (e.g., Slack, Discord bridges) where read receipts do not sync back to Matrix.
Problem
When using bridged rooms, reading messages on the other side (e.g., in Slack) does not update the Matrix read receipt. This causes
roomHaveUnread()to returntrueeven when the server notification count is 0, resulting in phantom badges.Solution
Make the server notification count authoritative. Only add a room to the unread list if the server actually reports notifications (
total > 0orhighlight > 0). This prevents phantom badges while still respecting the server's notification state.Testing