Repository navigation
refactor(core): Breakouts moderator vs viewer - #24704
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe changes make presenter-related flows breakout-aware across backend, GraphQL actions, and frontend. Breakout status is propagated (new isBreakout field and X-Hasura-IsBreakout header). Moderator validation for setting a presenter is bypassed for breakout sessions in GraphQL and backend handlers. Frontend components receive an isBreakout prop and allow "Take Presenter" when in breakouts. URL construction for joining breakout rooms now selects the appropriate password based on the user’s role. Sequence Diagram(s)sequenceDiagram
actor User
participant Frontend
participant GraphQL
participant Backend
rect rgba(100,150,200,0.5)
Note over User,Backend: Presenter Assignment - Non-Breakout
User->>Frontend: Click "Take Presenter"
Frontend->>Frontend: Check: amIModerator?
alt Is Moderator
Frontend->>GraphQL: setPresenter request
GraphQL->>GraphQL: throwErrorIfNotModerator()
GraphQL->>Backend: Update presenter
Backend-->>GraphQL: Success
GraphQL-->>Frontend: Presenter updated
else Not Moderator
Frontend-->>User: Action unavailable
end
end
rect rgba(150,200,100,0.5)
Note over User,Backend: Presenter Assignment - Breakout
User->>Frontend: Click "Take Presenter"
Frontend->>Frontend: Check: amIModerator OR isBreakout?
alt Is Moderator OR Is Breakout
Frontend->>GraphQL: setPresenter request (includes isBreakout)
GraphQL->>GraphQL: isBreakout? -> true (skip moderator check)
GraphQL->>Backend: Update presenter
Backend-->>GraphQL: Success
GraphQL-->>Frontend: Presenter updated
else Not Moderator AND Not Breakout
Frontend-->>User: Action unavailable
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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.
Actionable comments posted: 1
🤖 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/apps/users/AssignPresenterReqMsgHdlr.scala`:
- Line 37: In AssignPresenterReqMsgHdlr, add an explicit existence check for the
assignedBy user in liveMeeting.users2x before performing presenter reassignment
and before the chat announcement (avoid calling .get on a potentially None
user); if assignedBy is not found, log a warning and return without changing
presenter or sending the announcement. Specifically, around the existing
permission check/branch that bypasses permissionFailed for breakouts, guard
using users2x.contains(assignedBy) or users2x.get(assignedBy) pattern matching
and only proceed to call the presenter reassignment logic and the chat
announcement when the user exists.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4a828b25-2751-4e22-8297-eb71d9705d28
📒 Files selected for processing (9)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutHdlrHelpers.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/AssignPresenterReqMsgHdlr.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetUserApiMsgHdlr.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/service/UserInfoService.scalabbb-graphql-actions/src/actions/userSetPresenter.tsbbb-graphql-actions/src/imports/validation.tsbigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsxbigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/container.jsxbigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-participants/user-actions/service.ts
antobinary
left a comment
There was a problem hiding this comment.
Upon joining a breakout, neither of the 2 viewers became presenter

Perhaps we should assign the first user to be presenter regardless of role? When testing, each of the breakouts viewers had the option to take presenter (manageable but the extra step was a bit confusing)
Nice to see the chat between viewers not being an option in breakouts. The moderators though can be messaged and can initiate private chat too. 🎆
Great to see the different roles and the naturally flowing UI restrictions based on the role!!
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/apps/users/UsersApp.scala`:
- Around line 70-71: The fallback to pick a presenter in breakouts uses
Users2x.findAll(...).headOption which relies on HashMap iteration order and is
nondeterministic; change the fallback to pick the earliest joiner instead (e.g.
replace the headOption fallback with a join-order-aware selection such as
Users2x.findAll(liveMeeting.users2x).minByOption(_.joinTime) or
.minByOption(_.joinOrder), or call an existing Users2x helper like
findFirstJoined if present), or if no join timestamp exists add/maintain a
joinOrder/joinTimestamp in Users2x and use that to deterministically select the
first user to join when Users2x.findModerator(...) returns None.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 1d2dfb32-db6c-46e9-ac24-6c2199afbefb
⛔ Files ignored due to path filters (1)
bigbluebutton-tests/playwright/breakout/breakout.spec.ts-snapshots/breakout-moderator-chat-messages-Chromium-linux.pngis excluded by!**/*.png
📒 Files selected for processing (1)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala
|
antobinary
left a comment
There was a problem hiding this comment.
Tested locally and it works well! 🚀
✅ Automated tests have passed! |
…to breakouts akka-apps has appended userdata-bbb_parent_room_moderator=true|false to every breakout join URL since 9268e4c (2020, "Kick users from breakout rooms"). Back then every breakout participant joined with the moderator password, so the client needed a separate flag to let only parent-room moderators remove users inside a breakout. Nothing has read the flag since 3.0.25: - #24704 (3.0.23) made breakout join URLs carry the parent-room role, so a viewer is a viewer inside the breakout; - #24780 (3.0.25) removed the breakout special cases from the user actions, including the only reader of this flag. Remove-user is the plain moderator check in the client, and akka-apps enforces moderator level in EjectUserFromMeetingCmdMsgHdlr. The value still landed in user_metadata and in the ParticipantJoinEvent userdata of every breakout user. Drop it, together with the role argument of BreakoutRoomsUtil.joinParams that only fed it (the role still reaches bbb-web through the password parameter, as before). Docs: the parameter is listed under "Updated in 4.0 / join / Removed parameters" with the reason, and its row is gone from the user metadata table on the API page. akka-bbb-apps compiles (sbt compile in the bbb40 container, Java 21); scalariform leaves both files unchanged.



What does this PR do?
Closes Issue(s)
Closes #24703
Closes #24694
How to test