fix: @all/@here in a thread leaves no unread indicator for non-followers
Proposed changes (including videos or screenshots)
When someone replies in a thread with @all or @here, the whole room gets the notification, but only thread followers get any unread state. Everyone else dismisses the popup and finds nothing in the sidebar (no bold room, no badge).
The main channel handles this in updateUsersSubscriptions, but that bails out for any message with a tmid, so threads were never covered.
This adds a second update in reply() for the rest of the room on @all/@here: tunread, tunreadGroup, alert and open. The existing follower update stays as is, and followers and mentioned users are excluded from the new one, so they behave exactly as before. That's a bit different from the patch suggested in the issue, which replaced the follower update with a whole-room one. Members who muted @all/@here are skipped too, same as the notification path (the main channel counter doesn't check that flag, so happy to change it if you'd rather match it).
Added a changeset and unit tests for reply().
Issue(s)
Closes #43218
Steps to test or reproduce
- Users A and B in the same channel, B has default notification prefs.
- A replies in a thread B doesn't follow with
@all test. - B dismisses the popup and looks at the sidebar.
Before: nothing. Expected after: the channel is bold with a thread badge, and opening the thread clears it.
Verified with the unit tests in functions.test.ts (the group mention ones fail without the fix). Haven't run it against a full local instance.
Further comments
Two related things I noticed but left out of this PR: @all in a reply that is also sent to the channel (tshow) still doesn't update the room counters, since updateUsersSubscriptions bails on any tmid, and getSubscriptionUnreadData doesn't look at tunreadGroup, so the sidebar badge for a group mention in a thread is a plain thread badge.
Summary by CodeRabbit
- Bug Fixes
- Fixed
@alland@herementions in threads so eligible room members receive notifications and see unread indicators for the thread. The sender, thread followers, and mentioned users are excluded from the room-wide unread update. - Thread followers are correctly identified as group-mention recipients, and room-wide notifications are used for group mentions.
- Replies without a group mention continue to notify only the relevant users and do not trigger room-wide unread indicators or notifications.
- Fixed