Skip to content

feat(pre-flight): report the applied room mode - #26261

Draft
AtilaU19 wants to merge 80 commits into
bigbluebutton:v4.1.x-developfrom
AtilaU19:task-2851
Draft

AtilaU19 wants to merge 80 commits into
bigbluebutton:v4.1.x-developfrom
AtilaU19:task-2851

Conversation

@AtilaU19

@AtilaU19 AtilaU19 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

When a moderator applies a room mode, akka sends a RoomConfiguredEvtMsg and records it with the meeting's events as RoomConfiguredEvent. It carries the mode, the room's settings once the mode is applied, who applied it and when.

  • It is sent for every mode the server accepts, the current one included, since the Room modes tab applies the current mode again after an edit. RoomModeChangedEvtMsg is still sent only on a change.
  • The settings are read from the meeting's state, in the shape of roomBaseSettings.
  • It reaches events.xml in meetings that keep their events (record=true or meetingKeepEvents=true).

Stacked on #26255, #26188, #26180, #26113 and #26099; their commits sit below these.

In detail:

Closes Issue(s)

None

How to test

Turn on public.app.preFlight.enabled and public.app.preFlight.roomModes.enabled. Create a meeting with record=true, join as a moderator, pick Class and click Start room. List its RoomConfiguredEvents by the internal meeting id:

ID=<internal meeting id>
for n in $(redis-cli LRANGE meeting:$ID:recordings 0 -1); do
  K=recording:$ID:$n
  redis-cli HGET $K eventName | grep -q RoomConfigured \
    && redis-cli HGETALL $K
done
  1. One event: roomMode class, the moderator's userId, the room's settings.
  2. In Room modes, pick Meeting and click Change room mode: a second one.
  3. In the Meeting gear, switch the whiteboard on, apply, then Change room mode: a third one.
  4. Reload, then join as a second moderator: nothing new.
  5. End the meeting and archive it: the events are in its raw events.xml.

Automated: pre-flight/roomModeReport.spec.ts (2 cases, @ci). It reads the events with redis-cli, so it runs on the BBB host, as in CI. The pre-flight/ specs pass locally on LiveKit. These steps are also in release-testing.md, under "Room mode reported in the meeting's events".

More

  • CI: the room mode PRs add @ci cases, and CI splits them into shards by count, so shards 2 and 8 of install-and-run-bbb-tests can hit the 25-minute Run tests limit here with no test failing. test(playwright): trim the pre-flight E2E suite for CI #26284, on top of this series, trims the pre-flight suite (82 to 34 @ci tests).
  • Delivering the event to the front-end (bbb-webhooks or otherwise) is left for a follow-up.

Changelog

Technical — akka sends and records RoomConfiguredEvent each time a room mode is applied.

User-facing — None.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@germanocaumo germanocaumo 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.

Tested on a dev server: each time a mode is applied there is one RoomConfiguredEvent (class when the room starts, meeting after changing the mode), a second moderator joining adds none, and the events end up in the meeting's events.xml.

One small thing: release-testing.md has no section for roomModeReport.spec.ts. The "How to test" steps from this PR would fit there.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

Carry a room-level mode id on the meeting (empty means not configured),
readable by every client, including those still on the pre-flight, and
writable by a moderator through meetingSetRoomMode.

- bbb-common-message: SetRoomModeCmdMsg and RoomModeChangedEvtMsg
- akka-bbb-apps: MeetingStatus2x mirror, handler (moderator only, not
  in breakout rooms), MeetingDAO column and update, event broadcast
- bbb-graphql-server: meeting."roomMode" column, exposed to bbb_client
  and bbb_client_not_in_meeting, and the meetingSetRoomMode action
- bbb-graphql-actions: meetingSetRoomMode handler (moderator only, id
  validated as ^([a-z][a-z0-9-]{0,31})?$)
- bbb-graphql-middleware: allow the getRoomMode operation for users who
  have not joined yet
- bigbluebutton-html5: read roomMode in the meeting subscription
- tests: pre-flight/roomMode.spec.ts
Address the inline comments of the bigbluebutton#26099 review:

- bbb-graphql-actions: refuse a breakout room up front; akka refuses it
  too, but only after the call has answered true
- akka-bbb-apps: log RoomModeChangedEvtMsg in AnalyticsActor
- playwright: runMutation returns a rejected call as errors, so callers
  get one shape
- playwright: skip, naming the requirement, when the Apollo probe is not
  exposed (allowOverrideClientSettingsOnCreateCall)
- playwright: assert user_current.joined is false on the pre-join read
- playwright: cover the refusals only akka makes (a moderator still on the
  pre-flight, a breakout room) and invalid ids
- playwright: drop the viewer removal from the reload case, which could
  not fail on the room mode
feat(pre-flight): add room mode state on the meeting

Carry a room-level mode id on the meeting (empty means not configured),
readable by every client, including those still on the pre-flight, and
writable by a moderator through meetingSetRoomMode.

- bbb-common-message: SetRoomModeCmdMsg and RoomModeChangedEvtMsg
- akka-bbb-apps: MeetingStatus2x mirror, handler (moderator only, not
  in breakout rooms), MeetingDAO column and update, event broadcast
- bbb-graphql-server: meeting."roomMode" column, exposed to bbb_client
  and bbb_client_not_in_meeting, and the meetingSetRoomMode action
- bbb-graphql-actions: meetingSetRoomMode handler (moderator only, id
  validated as ^([a-z][a-z0-9-]{0,31})?$)
- bigbluebutton-html5: read roomMode in the meeting subscription and in
  userCurrentSubscription (user_current.meeting), which users who have
  not joined yet already receive
- tests: pre-flight/roomMode.spec.ts
Refuse an empty room mode, in bbb-graphql-actions and in akka. Empty is
only the column's default: accepting it let any moderator reopen the
pre-flight panel for everyone arriving after them, and no client path
needs to clear the mode. The invalid-mode case now also sends ''.
Follow the probe's switch upstream from the raw create module (APOLLO_CLIENT_SETTINGS_MODULE) to APOLLO_CLIENT_SETTINGS_OVERRIDE through createClientSettingsOverride.
Sort the breakout create import as simple-import-sort expects (playwright-code-validation).
The pre-flight is getting a room mode panel for moderators entering a
room nobody has configured. Picking a mode applies nothing to the room
yet, so the panel needs a switch of its own, off by default and apart
from the pre-flight's.

Add public.app.preFlight.roomModes.enabled (false), overridable per
session with userdata-bbb_pre_flight_room_modes, and
isRoomModePanelEnabled, which also requires the pre-flight and is
therefore off in breakout rooms.
The join's notices ("Device permission pending", joining without
audio) live in the join step's header, and the join button points at
one of them with aria-describedby. A second panel beside the setup one
has to show the same notices above its own footer and start the room
with the same join.

Move the notices into JoinNotices, rendered by exactly one place, and
let JoiningRoomHeader leave them out. JoiningRoomActions takes an
optional label and a secondary action shown before the button. The
screen itself is unchanged.
The pre-flight lays out the setup panel and the join step side by
side, stacked on a phone. The moderator's room mode panel needs a
place of its own beside the setup panel.

PreFlight takes an optional panel. Beside the setup panel it replaces
the join step, with the actions as its footer; the session's heading
stays in the page, visually hidden, as its heading and title. An error
still takes the panel's place, as it takes the join step's.

On a phone the panels become tabs, "Set up devices" and "Set up room",
with the actions pinned below both. The panels stay mounted and are
only hidden, so the camera preview and the picks survive switching.
The setup panel is always inside the tabs on a phone, with the tab
list hidden while it is alone, so a panel arriving later does not
remount it.
A moderator entering a room nobody has configured has nowhere in the
pre-flight to say what the session is for.

With the room mode panel setting on, a moderator entering a room whose
room mode is empty (not a bot, not in a breakout) gets a "Room mode"
panel beside the setup panel. The mode is read before the join through
the getRoomMode operation, which the middleware lets through for users
who have not joined yet. A spinner holds the join button's place while
it is read; a read that fails or gets no answer in 10 seconds falls
back to the regular join step.

Class and Meeting can be picked; Event, Streamed session (Webinar) and
Thesis defense are listed as coming soon. The cards form a radio
group, with the arrow keys moving between the modes that can be
picked. Until a pick, the panel shows an illustration, with a dark
variant for the dark theme since an image cannot read its tokens; then
the selected mode. Cancel clears the pick (not on a phone, as in the
design) and Start room joins, with or without a mode.

The pick only lives in the pre-flight's state: nothing reaches the
room yet, so starting leaves the room as it was created.
feat(pre-flight): add the moderator room mode panel

A moderator entering a room nobody has configured has nowhere in the
pre-flight to say what the session is for.

With the room mode panel setting on, a moderator entering a room whose
room mode is empty (not a bot, not in a breakout) gets a "Room mode"
panel beside the setup panel. The mode is read before the join from
user_current.meeting, which userCurrentSubscription already carries for
users who have not joined yet. A spinner holds the join button's place
until it arrives.

Class and Meeting can be picked; Event, Streamed session (Webinar) and
Thesis defense are listed as coming soon. The cards form a radio
group, with the arrow keys moving between the modes that can be
picked. Until a pick, the panel shows an illustration, with a dark
variant for the dark theme since an image cannot read its tokens; then
the selected mode. Cancel clears the pick (not on a phone, as in the
design) and Start room joins, with or without a mode.

The pick only lives in the pre-flight's state: nothing reaches the
room yet, so starting leaves the room as it was created.
Give up a room mode change after ROOM_MODE_APPLY_TIMEOUT, as the pre-flight does: the steps not yet sent are skipped, the change-failed notice shows and the settings window unlocks.
Take 0.11.0 instead: BBBToggle now has a disabled look (dimmed text and checked track, not-allowed cursor), so the switches under "Fixed for this session" in the Room modes tab no longer look editable. The title becomes 'bump bbb-ui-components-react to 0.11.0' when squashed.
feat(pre-flight): bring back what only the previous room mode set

The applier set a mode over the room's current state, so whatever a
previous mode had set stayed where the new mode is silent. That was
harmless while modes were only applied to a room nobody had
configured, but a mode changed during the session must not leave the
previous one behind, nor undo what a moderator changed by hand.

The applier now reads the room's base settings. A setting the previous
mode's preset set and the new mode's preset leaves out goes back to
the base. Everything else the mode and the edits leave out is not
sent, so a lock no mode sets, a change made by hand and an edit
applied with the previous mode stay as the room has them; so does a
setting the new mode sets but leaves out, such as public chat in a
room without chat. A room created before the base was kept, or one
whose base cannot be read, keeps what the previous mode set, and the
failed read is logged; it never holds the applier waiting. A previous
mode this client does not know is logged too.

The pre-flight goes through the same applier. The guest policy its
summary showed is the one applied: left unedited, that is the room's
current policy, so it is passed along as an edit.

settingsToApply moves next to the other room mode settings so the
in-session change can share it, and lockSettingsVariables takes just
the eleven lock settings, which is all the base carries.
…applied

Review (bigbluebutton#26255, point 1): a mode switch no longer goes back to the room as
created, so the guest policy the pre-flight showed is not passed along
as an edit, neither to the apply nor to the room modes tab. Left out, it
stays as the room has it, which also keeps a change another moderator
made meanwhile.
Review (bigbluebutton#26255, point 1): switching applies the new mode's settings and
leaves what no mode sets as the room has it. The tab shows the room's
current guest policy instead of the one it was created with, and the
docs and release tests describe the new rule.
Review (bigbluebutton#26255, point 1): after a switch from Class to Meeting, the guest
policy and the private chat lock changed by hand stay. RED against the
previous applier, which put the guest policy back to the room's own.
Review (bigbluebutton#26255, point 1): the base is what a switch brings back for a
setting only the previous mode set, not what every mode is applied over.
The room's base settings (meeting.roomBaseSettings) were built as a
nested map inside MeetingDAO, the only place that knew their shape.

RoomModeSettings in bbb-common-message now holds that shape: the lock
settings, the users policies and the voice settings a room mode
controls. MeetingDAO writes RoomModeSettings.fromProps, and the stored
JSON keeps the same fields and values.
Nothing left BBB when a room mode was applied, so the front-end that
owns the room could not learn what the moderator chose.

SetRoomModeCmdMsgHdlr now sends RoomConfiguredEvtMsg for every room
mode it accepts, the current one included: the Room modes tab applies
the current mode again when one of its settings is edited. The event
carries the mode, the settings the room has once the mode is applied,
who applied it and when. The settings are read from the meeting's
state; the client applies them before it sets the mode, through the
same meeting actor, so they are in place when the event is built.
RoomModeChangedEvtMsg is still sent only when the mode changes.

The recorder stores the event as RoomConfiguredEvent, with the
settings as JSON in the base settings' shape, so it reaches events.xml
in meetings that keep their events (record or meetingKeepEvents).
roomModeReport.spec covers RoomConfiguredEvent in two cases. Each
apply is recorded once, with the room's settings and who applied it:
from the pre-flight, a change in the Room modes tab, and the same mode
applied again there with an edit. A reload or a second moderator
records nothing, and the record is still in the meeting's events after
the meeting ends.

The events are read where the server keeps them: from its Redis with
redis-cli (core/recordedEvents), or from the archived events.xml once
the recording is archived. The tests skip when that Redis does not
hold the meeting, so they run on the BBB host, as in CI. The room is
created with meetingKeepEvents=true, so a server that stops recording
fails them instead.
…s events

Add the manual steps for roomModeReport.spec.ts to release-testing.md, from the PR's How to test.
Give the focus back to the window when a room mode change fails: it
sat on "Change room mode", disabled while applying, so it fell to the
page and Esc did nothing until a click inside the window. It goes back
to the button, or to the window when the button stays disabled, and
only when it is not in the window already. roomModeSwitch covers it by
dropping SetRoomMode and pressing Esc once the change is given up.
Give the guest policy row a key of its own,
app.preFlight.roomMode.settings.guestPolicy ("Guest policy"): the
app.guest-policy.title it used left en.json in 707b4ff, so the
summary showed the message id. The summary test now checks that no
label shows a message id.
A reload lands on the pre-flight once the server has removed the user
who left, and the room layout never shows. The reload step now accepts
both landings: on the pre-flight, it checks there is no panel and joins
the room.
The reload after the switch can land on the pre-flight once the server
has removed the user who left. It now goes through reloadsIntoRoom,
which accepts both landings.
…s events

The reload can land on the pre-flight once the server has removed the
user who left. It now goes through reloadsIntoRoom, which accepts both
landings.
@github-actions

Copy link
Copy Markdown

⏳ Automated tests are running...

This branch has not been deployed

No deployments
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.

2 participants