Fix read marker triggering room-wide notifications on alias mention#2562
Merged
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
ajbura
added a commit
to cinnyapp/cla
that referenced
this pull request
Jan 1, 2026
ajbura
requested changes
Jan 4, 2026
|
Preview: https://2562--pr-cinny.netlify.app |
Contributor
Author
|
Hi @ajbura |
kfiven
approved these changes
Jan 12, 2026
ajbura
approved these changes
Jan 12, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Fixes bug where mentioning a room's alias (e.g.,
#room:server.com) incorrectly triggers@room-like notifications for all members instead of treating it as a regular link.Problem
When a message contained the current room's alias, the
getMentions()function incorrectly set"room": truein them.mentionsfield. This caused all members with "Contains @room: Notify Loud" enabled to receive notifications, even when the room alias was mentioned as a regular link and not as an@roommention.Root cause: Both
@roommentions (via autocomplete) and manually typed room aliases resolve to the same room alias ID, making them indistinguishable when only checking thenode.id.Solution
Modified the
getMentions()function to distinguish between:#→ Setsroom: true✓#→ Treated as regular link ✓The fix checks the
node.name(display text) instead of just thenode.idto determine intent.Changes
getMentions()insrc/app/components/editor/util.ts(or your file path)if (!node.name.startsWith('#'))before settingmentionData.room = true@roommentions trigger room-wide notificationsTesting
Tested with 3 users in a room with alias
#test:matrix.org:Before fix:
@user:server.com welcome to #test:matrix.org→ All members notifiedCheck #test:matrix.org→ All members notifiedAfter fix:
@room hello→ All members notified@user:server.com welcome to #test:matrix.org→ Only @user notifiedCheck #test:matrix.org→ No one notifiedIssue Number
Fixes #2533