Skip to content

refactor(core): Breakouts moderator vs viewer - #24704

Merged
antobinary merged 8 commits into
bigbluebutton:v3.0.x-releasefrom
ramonlsouza:breakout-users
Mar 6, 2026
Merged

antobinary merged 8 commits into
bigbluebutton:v3.0.x-releasefrom
ramonlsouza:breakout-users

Conversation

@ramonlsouza

@ramonlsouza ramonlsouza commented Mar 4, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

  • adjusts breakout join so viewers join as viewers, instead of making all users moderators
  • changes "set presenter" and "take presenter" permission, allowing viewers to change presenter in breakout rooms

Closes Issue(s)

Closes #24703
Closes #24694

How to test

  1. join a meeting with moderator A and viewer B
  2. create breakout rooms
  3. join a breakout room with the viewer and the moderator
  4. in the breakout room, both users should have the same type as in the main room (A is a moderator, B is a viewer)

@coderabbitai

coderabbitai Bot commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • bigbluebutton-tests/playwright/breakout/breakout.spec.ts-snapshots/breakout-moderator-chat-messages-Chromium-linux.png is excluded by !**/*.png

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1be4c29c-423a-4c7e-8c1c-0fbda3aede9a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The 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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adjusting breakout logic to preserve moderator vs viewer roles instead of making all users moderators.
Description check ✅ Passed The description clearly explains what the PR does, references the linked issues, and provides concrete testing steps related to the changeset.
Linked Issues check ✅ Passed The changes implement all key coding objectives from linked issues: preserving main-room roles in breakouts [#24703], enabling role-based permissions for presenter changes [#24703, #24694], restricting moderator-only actions, and propagating role details to enforce breakout permissions.
Out of Scope Changes check ✅ Passed All code changes are directly related to role preservation and permission adjustments in breakouts. The test file update (join.ts) is a minimal adjustment to use the moderator join path, which is consistent with the feature objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e0542ad and 153c04b.

📒 Files selected for processing (9)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutHdlrHelpers.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/AssignPresenterReqMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetUserApiMsgHdlr.scala
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/service/UserInfoService.scala
  • bbb-graphql-actions/src/actions/userSetPresenter.ts
  • bbb-graphql-actions/src/imports/validation.ts
  • bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx
  • bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/container.jsx
  • bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-participants/user-actions/service.ts

@antobinary antobinary added this to the Release 3.0 milestone Mar 4, 2026
@antobinary
antobinary self-requested a review March 4, 2026 16:58
@antobinary antobinary changed the title Breakouts moderator vs viewer refactor: Breakouts moderator vs viewer Mar 5, 2026
@antobinary antobinary changed the title refactor: Breakouts moderator vs viewer refactor(core): Breakouts moderator vs viewer Mar 5, 2026

@antobinary antobinary left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon joining a breakout, neither of the 2 viewers became presenter
image

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. 🎆


image

Great to see the different roles and the naturally flowing UI restrictions based on the role!!

@ramonlsouza
ramonlsouza requested a review from antobinary March 5, 2026 19:03

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between edeb9c3 and 95aa1b8.

⛔ Files ignored due to path filters (1)
  • bigbluebutton-tests/playwright/breakout/breakout.spec.ts-snapshots/breakout-moderator-chat-messages-Chromium-linux.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala

@sonarqubecloud

sonarqubecloud Bot commented Mar 6, 2026

Copy link
Copy Markdown

@antobinary antobinary left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and it works well! 🚀

@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary
antobinary merged commit 5326ea8 into bigbluebutton:v3.0.x-release Mar 6, 2026
32 checks passed
ramonlsouza pushed a commit that referenced this pull request Oct 20, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breakouts moderator vs viewer Breakouts lock settings private chat

2 participants