Repository navigation
fix: suppress join/leave notifications for locked viewers when hideUserList is active - #24924
Conversation
hideUserList is active When lockSettingsHideUserList=true, locked viewers were still receiving audio/push notifications for user join and leave events, leaking usernames via the notification stream which bypasses Hasura and is broadcast to all browser connections directly from Redis. Instead of broadcasting to all, iterate active users and send per-user notifications only to moderators and unlocked viewers.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR makes join and leave notification delivery conditional on the meeting permission hideUserList. For both user-join (HandlerHelpers.userJoinMeeting) and deferred user-leave expiration (MeetingActor.removeUsersWithExpiredUserLeftFlag) flows: when hideUserList is true and the subject is not a moderator, the code enumerates meeting users, filters out users who left and restricts recipients to unlocked users or moderators, then builds/sends a per-recipient Sequence Diagram(s)sequenceDiagram
participant MeetingActor
participant HandlerHelpers
participant Users2x
participant OutGW
participant NotificationDAO
Note over MeetingActor,HandlerHelpers: user join or deferred-leave handling
MeetingActor->>HandlerHelpers: handle join/leave request
HandlerHelpers->>MeetingActor: determine liveMeeting & subject role
alt hideUserList = true and subject not moderator
HandlerHelpers->>Users2x: findAll(liveMeeting.users2x)
Users2x-->>HandlerHelpers: user list
loop per recipient (not left && (unlocked || moderator))
HandlerHelpers->>OutGW: buildNotifyUserInMeetingEvtMsg -> send to recipient
HandlerHelpers->>NotificationDAO: insert per-recipient notification
end
else
HandlerHelpers->>OutGW: buildNotifyAllInMeetingEvtMsg -> broadcast
HandlerHelpers->>NotificationDAO: insert single notification
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adjusts server-side join/leave notification emission to prevent locked viewers from receiving (and thus leaking) participant join/leave usernames when lockSettingsHideUserList=true, aligning notification behavior with the “hidden user list” lock setting.
Changes:
- When
hideUserListis enabled, replaces meeting-wide join/leave notifications with per-user notifications targeting only moderators and unlocked users. - Keeps existing broadcast (“notify all”) behavior when
hideUserListis disabled. - Minor formatting/alignment adjustments in
MeetingActormessage handling cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala | Changes leave notification emission to avoid notifying locked viewers when hideUserList is active. |
| akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/HandlerHelpers.scala | Changes join notification emission to avoid notifying locked viewers when hideUserList is active. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ramonlsouza
left a comment
There was a problem hiding this comment.
- with these changes, a locked viewer will not receive moderators join/leave notifications... is it expected? (maybe we should only ignore if the notification is from a viewer)
- when hideUserList is active, the name being displayed in user left notification is incorrect (it is displaying the current user's name, not the name of the user that left)
Screencast.from.2026-04-16.10-03-46.mp4
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala (2)
1157-1180: Minor: inconsistent name interpolation between branches.Line 1157 extracts
val leaverName = u.nameand uses it directly on line 1168, but theelsebranch on line 1180 re-interpolates ass"${u.name}". Useu.name(orleaverName) in both places for consistency and to drop the unnecessarys""wrapping.🧹 Proposed tidy-up
- Map("userName" -> s"${u.name}") + Map("userName" -> u.name)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala` around lines 1157 - 1180, The code mixes direct use of u.name and an unnecessary string interpolation s"${u.name}" when building the leave notification; make them consistent by using the extracted val leaverName (or u.name) in both branches — update the buildNotifyAllInMeetingEvtMsg call to pass Map("userName" -> leaverName) (or Map("userName" -> u.name)) so it matches the foreach branch that uses leaverName and removes the redundant s"" interpolation.
1156-1184: Extract duplicated notification-gating logic into a shared helper.This branching block is essentially identical to the newly added join-notification block in
HandlerHelpers.scala(lines 104–131), differing only in themessageId/user-name source. Duplicating thehideUserList+!moderator+!left && (!locked || moderator)filter in two places invites drift (e.g., someone later fixing the filter in only one copy). A small helper inHandlerHelpers(or a new object) taking(liveMeeting, subjectUser, messageId, description)and performing the per-recipient vs. broadcast decision would keep both flows in sync.♻️ Sketch of a shared helper
// In HandlerHelpers (or a dedicated object): def sendUserJoinLeaveNotification( outGW: OutMsgRouter, liveMeeting: LiveMeeting, subject: UserState, messageId: String, messageDescription: String ): Unit = { val meetingId = liveMeeting.props.meetingProp.intId val values = Map("userName" -> subject.name) if (MeetingStatus2x.getPermissions(liveMeeting.status).hideUserList && subject.role != Roles.MODERATOR_ROLE) { Users2x.findAll(liveMeeting.users2x) .filter(r => !r.userLeftFlag.left && (!r.locked || r.role == Roles.MODERATOR_ROLE)) .foreach { r => val evt = MsgBuilder.buildNotifyUserInMeetingEvtMsg( r.intId, meetingId, "info", "user", messageId, messageDescription, values) outGW.send(evt) NotificationDAO.insert(evt) } } else { val evt = MsgBuilder.buildNotifyAllInMeetingEvtMsg( meetingId, "info", "user", messageId, messageDescription, values) outGW.send(evt) NotificationDAO.insert(evt) } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala` around lines 1156 - 1184, The leave-notification branch in MeetingActor duplicates the same hideUserList + role + recipient filter logic found in HandlerHelpers.scala for joins; extract that logic into a shared helper (e.g., HandlerHelpers.sendUserJoinLeaveNotification) that accepts (outGW: OutMsgRouter, liveMeeting: LiveMeeting, subject: UserState, messageId: String, messageDescription: String) and performs the per-recipient vs broadcast decision, builds the MsgBuilder event(s) and calls outGW.send + NotificationDAO.insert; replace the duplicated blocks in MeetingActor (the current leave block) and the join block in HandlerHelpers (lines ~104–131) with calls to this helper, passing the appropriate messageId and description and the subject user to avoid drift.bigbluebutton-tests/playwright/user/lockViewers.ts (2)
535-540: Nit:UPLOAD_PDF_WAIT_TIMEis a semantically misleading timeout for leave-notification waits.
UPLOAD_PDF_WAIT_TIMEis defined under "MEDIA CONNECTION TIMEOUTS" (for PDF uploads, 30s). Reusing it here just because the numeric value matches the ~20suserLeftFlagexpiry + audit tick makes these tests harder to understand and creates a bogus coupling: if someone tunes PDF upload timeouts they’ll unintentionally affect notification tests. Consider introducing a dedicated constant (e.g.,USER_LEFT_NOTIFICATION_WAIT_TIME) or just using a named local with a comment explaining the 10s flag expiry + 10s audit interval.Also applies to: 671-683
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bigbluebutton-tests/playwright/user/lockViewers.ts` around lines 535 - 540, Replace the semantically misleading UPLOAD_PDF_WAIT_TIME used in leave-notification assertions with a dedicated timeout constant or named local to reflect the user-left notification semantics: add USER_LEFT_NOTIFICATION_WAIT_TIME (or a local like userLeftNotificationWait = 20000) and use it in calls such as this.modPage.hasText(e.smallToastMsg, `${leavingUsername} left the session`, ..., USER_LEFT_NOTIFICATION_WAIT_TIME); update all other occurrences mentioned (around the other block at 671-683) so the tests no longer reuse the MEDIA CONNECTION timeout and include a brief comment explaining the value (e.g., 10s userLeftFlag expiry + 10s audit interval).
474-479: Replace hardcoded English notification strings with locale-aware constants or a shared pattern.These tests hardcode
"${username} joined the session"and"${username} left the session"strings, which are sourced from i18n (app.notification.userJoinPushAlert/userLeavePushAlert). If tests run under a non-English locale or if the source string changes, all these assertions break.The codebase establishes a pattern of using toast constants from
elements.ts(e.g.,e.attendeeJoinedToastused innotifications/notifications.ts). While anattendeeJoinedToastconstant exists, it uses static text without the username. Consider either:
- Creating new constants for user join/leave notifications with dynamic username templating
- Adopting the
checkNotificationTexthelper pattern fromnotifications/util.ts- Pulling the expected strings from a locale-aware source at test runtime
Occurs at lines 476, 537, 607, 614, 673, 680, 735, 742, 790, 797 (shown in snippet above; also applies to lines 535–540, 605–617, 671–683, 733–745, 788–800).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bigbluebutton-tests/playwright/user/lockViewers.ts` around lines 474 - 479, Replace hardcoded English join/leave notification assertions with a locale-aware approach: stop using `${this.userPage2.username} joined the session` in hasText calls and instead use the existing toast constant or helper pattern—either add templated constants like e.userJoinToast and e.userLeaveToast that accept a username, or call the notifications/util.ts helper checkNotificationText (or equivalent) to build/verify the localized message at runtime; update calls that reference e.smallToastMsg and the hasText assertion (e.g., in lockViewers.ts where hasText is invoked) to use the new templated constants or the checkNotificationText helper so tests remain locale-independent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala`:
- Around line 1156-1172: The current per-recipient loop inside the
removeUsersWithExpiredUserLeftFlag audit (using Users2x.findAll and
building/sending NotifyUserInMeetingEvtMsg per recipient) fans out linearly and
should be replaced with a single broadcast to avoid O(N^2) outbound work; change
the code that builds/sends per-recipient notifications (the loop that calls
MsgBuilder.buildNotifyUserInMeetingEvtMsg, outGW.send and
NotificationDAO.insert) to create one notification event and broadcast it once
to the meeting (use the appropriate broadcast/sendAll method or build a
meeting-scoped NotifyUserInMeetingEvtMsg), and similarly avoid calling
NotificationDAO.insert per recipient (either insert once or skip if no-op) so
the MeetingActor thread does a single send instead of N sends.
---
Nitpick comments:
In
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala`:
- Around line 1157-1180: The code mixes direct use of u.name and an unnecessary
string interpolation s"${u.name}" when building the leave notification; make
them consistent by using the extracted val leaverName (or u.name) in both
branches — update the buildNotifyAllInMeetingEvtMsg call to pass Map("userName"
-> leaverName) (or Map("userName" -> u.name)) so it matches the foreach branch
that uses leaverName and removes the redundant s"" interpolation.
- Around line 1156-1184: The leave-notification branch in MeetingActor
duplicates the same hideUserList + role + recipient filter logic found in
HandlerHelpers.scala for joins; extract that logic into a shared helper (e.g.,
HandlerHelpers.sendUserJoinLeaveNotification) that accepts (outGW: OutMsgRouter,
liveMeeting: LiveMeeting, subject: UserState, messageId: String,
messageDescription: String) and performs the per-recipient vs broadcast
decision, builds the MsgBuilder event(s) and calls outGW.send +
NotificationDAO.insert; replace the duplicated blocks in MeetingActor (the
current leave block) and the join block in HandlerHelpers (lines ~104–131) with
calls to this helper, passing the appropriate messageId and description and the
subject user to avoid drift.
In `@bigbluebutton-tests/playwright/user/lockViewers.ts`:
- Around line 535-540: Replace the semantically misleading UPLOAD_PDF_WAIT_TIME
used in leave-notification assertions with a dedicated timeout constant or named
local to reflect the user-left notification semantics: add
USER_LEFT_NOTIFICATION_WAIT_TIME (or a local like userLeftNotificationWait =
20000) and use it in calls such as this.modPage.hasText(e.smallToastMsg,
`${leavingUsername} left the session`, ..., USER_LEFT_NOTIFICATION_WAIT_TIME);
update all other occurrences mentioned (around the other block at 671-683) so
the tests no longer reuse the MEDIA CONNECTION timeout and include a brief
comment explaining the value (e.g., 10s userLeftFlag expiry + 10s audit
interval).
- Around line 474-479: Replace hardcoded English join/leave notification
assertions with a locale-aware approach: stop using `${this.userPage2.username}
joined the session` in hasText calls and instead use the existing toast constant
or helper pattern—either add templated constants like e.userJoinToast and
e.userLeaveToast that accept a username, or call the notifications/util.ts
helper checkNotificationText (or equivalent) to build/verify the localized
message at runtime; update calls that reference e.smallToastMsg and the hasText
assertion (e.g., in lockViewers.ts where hasText is invoked) to use the new
templated constants or the checkNotificationText helper so tests remain
locale-independent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: f495d9e4-a0b8-483a-a278-56fed96381e6
📒 Files selected for processing (4)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/HandlerHelpers.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scalabigbluebutton-tests/playwright/user/lockViewers.tsbigbluebutton-tests/playwright/user/user.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- bigbluebutton-tests/playwright/user/user.spec.ts
|
|
- Replace UPLOAD_PDF_WAIT_TIME with USER_LEFT_NOTIFICATION_WAIT_TIME in
leave-notification assertions (semantic correctness)
- Fix assertion order in join tests: positive (mod sees toast) before
negative (locked viewer doesn't), preventing false positives on slow CI
- Replace PR# reference with issue# in test comment (stable reference)
- Remove redundant s"${x.name}" string interpolation in HandlerHelpers
and MeetingActor (s"" wrapping a String is a no-op)
|
Relevants Ai suggestions applied, ready to review and merge |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
bigbluebutton-tests/playwright/user/lockViewers.ts (1)
432-482: Test correctness depends onlockOnJoinbeing implicitly enabled by thelockUserListtoggle.The fix's server-side filter is
!recipient.locked || recipient.role == MODERATOR_ROLE, so the "locked viewer must not receive a notification" assertion on line 477 only actually validates the fix if Viewer1 joined withlocked=true. That requireslockOnJoin=trueat the moment of join — but the test only togglese.lockUserListin the UI (line 436). The doc comment on line 426 asserts "(hideUserList=true, lockOnJoin=true)" but this is only true if the lock-viewers modal cascades tolockOnJoinor the env default already has it on.If
lockOnJoinwere ever changed to default-off (or the cascade behavior changes), these tests would silently pass by accident (Viewer1 would be unlocked and legitimately not affected by suppression, but that's not what's under test). Worth either explicitly asserting Viewer1'slockedstate in the UI before the act phase, or explicitly togglinglockOnJoinin the modal to pin the precondition.Same caveat applies to
hideUserListSuppressesLeaveNotification,hideUserListJoinNotificationVisibleForUnlockedAndModOnly, andhideUserListLeaveNotificationVisibleForUnlockedAndModOnly.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bigbluebutton-tests/playwright/user/lockViewers.ts` around lines 432 - 482, The test relies on lockOnJoin being enabled but only clicks e.lockUserList; update hideUserListSuppressesJoinNotification to either (A) explicitly enable the lockOnJoin option in the lock-viewers modal (use openLockViewers and click the lockOnJoin control) before applying locks, or (B) after initUserPage assert that Viewer1 is locked (check the UI/state for locked=true) and fail if not; apply the same explicit toggle or assertion pattern to the sibling tests hideUserListSuppressesLeaveNotification, hideUserListJoinNotificationVisibleForUnlockedAndModOnly, and hideUserListLeaveNotificationVisibleForUnlockedAndModOnly so the precondition is pinned.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@bigbluebutton-tests/playwright/user/lockViewers.ts`:
- Around line 432-482: The test relies on lockOnJoin being enabled but only
clicks e.lockUserList; update hideUserListSuppressesJoinNotification to either
(A) explicitly enable the lockOnJoin option in the lock-viewers modal (use
openLockViewers and click the lockOnJoin control) before applying locks, or (B)
after initUserPage assert that Viewer1 is locked (check the UI/state for
locked=true) and fail if not; apply the same explicit toggle or assertion
pattern to the sibling tests hideUserListSuppressesLeaveNotification,
hideUserListJoinNotificationVisibleForUnlockedAndModOnly, and
hideUserListLeaveNotificationVisibleForUnlockedAndModOnly so the precondition is
pinned.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 81d8bc65-6493-4791-9234-61aef698ebfb
📒 Files selected for processing (4)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/HandlerHelpers.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scalabigbluebutton-tests/playwright/core/constants.tsbigbluebutton-tests/playwright/user/lockViewers.ts
✅ Files skipped from review due to trivial changes (1)
- bigbluebutton-tests/playwright/core/constants.ts
leaverName was declared inside the if-branch, making it unavailable in the else-branch and causing a compilation error.
|
✅ Automated tests have passed! |
88ed5e5
into
bigbluebutton:v3.0.x-develop


What does this PR do?
Add a Filter for Locked Viewer not see joined/left users.
Closes Issue(s)
Closes #24888
Motivation
How to test