Skip to content

Fix read marker triggering room-wide notifications on alias mention#2562

Merged
kfiven merged 2 commits into
cinnyapp:devfrom
Santhoshkumar044:fix-mentionRoom-2533
Jan 12, 2026
Merged

Fix read marker triggering room-wide notifications on alias mention#2562
kfiven merged 2 commits into
cinnyapp:devfrom
Santhoshkumar044:fix-mentionRoom-2533

Conversation

@Santhoshkumar044
Copy link
Copy Markdown
Contributor

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": true in the m.mentions field. 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 @room mention.

Root cause: Both @room mentions (via autocomplete) and manually typed room aliases resolve to the same room alias ID, making them indistinguishable when only checking the node.id.

Solution

Modified the getMentions() function to distinguish between:

  • @room mentions → Display name doesn't start with # → Sets room: true
  • Room alias mentions → Display name starts with # → Treated as regular link ✓

The fix checks the node.name (display text) instead of just the node.id to determine intent.

Changes

  • Updated getMentions() in src/app/components/editor/util.ts (or your file path)
  • Added condition: if (!node.name.startsWith('#')) before setting mentionData.room = true
  • This ensures only actual @room mentions trigger room-wide notifications

Testing

Tested with 3 users in a room with alias #test:matrix.org:

Before fix:

  • @user:server.com welcome to #test:matrix.org → All members notified
  • Check #test:matrix.org → All members notified

After fix:

  • @room hello → All members notified
  • @user:server.com welcome to #test:matrix.org → Only @user notified
  • Check #test:matrix.org → No one notified

Issue Number

Fixes #2533

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 1, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Santhoshkumar044
Copy link
Copy Markdown
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 ajbura self-assigned this Jan 3, 2026
Comment thread src/app/components/editor/output.ts Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 9, 2026

Preview: https://2562--pr-cinny.netlify.app
⚠️ Exercise caution. Use test accounts. ⚠️

@Santhoshkumar044
Copy link
Copy Markdown
Contributor Author

Hi @ajbura
I have addressed the requested changes and updated it, The latest Netlify preview reflects the fixes.
Ready for re-review.Thanks!

@kfiven kfiven requested a review from ajbura January 12, 2026 12:08
@kfiven kfiven merged commit 073a9f5 into cinnyapp:dev Jan 12, 2026
2 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 12, 2026
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.

When mentioning a room's own alias in the room, it sends unintended room ping (similar to old @room behavior)

3 participants