Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
germanocaumo
left a comment
There was a problem hiding this comment.
I tested this on a dev server running the whole series. The tab works well: changing the mode applies it, a reload or a second moderator doesn't apply anything again, and "Open room modes" opens the tab with the pick already made. I found three problems, explained inline with steps to reproduce. The first one is the most important.
To reproduce, create a meeting with
lockSettingsDisablePublicChat=true&lockSettingsLockOnJoin=false&lockSettingsPresenterPolicy=freeForAll&webcamsOnlyForModerator=true&muteOnStart=false&record=true
and join moderators with userdata-bbb_pre_flight=true&userdata-bbb_pre_flight_room_modes=true.
| if (!lockSettings || !usersPolicies) throw new Error('the meeting data has not arrived'); | ||
|
|
||
| // Each setting the mode and the edits leave out takes the base's value. | ||
| const guestPolicy = settings.guestPolicy ?? base?.usersPolicies.guestPolicy; |
There was a problem hiding this comment.
Changing the mode also resets settings that no mode controls: the guest policy and most lock settings (microphone, camera, private chat, notes…) go back to how the room was created. A moderator's own changes are undone without any warning.
Steps:
- Join as a moderator, pick Class and click Start room.
- Open Lock viewers. Set the guest policy to "Always deny", turn off "Share microphone" and click Apply.
- Open Settings > Room modes and click the gear of Meeting: the guest policy shows "Always accept", and the microphone lock isn't listed.
- Go back, pick Meeting and click Change room mode.
Result: the guest policy is "Always accept" again and the microphone is unlocked for everyone.
The same happens through "Open room modes": moderator B joins first and does step 2; moderator A picks Class in the pre-flight and clicks Start room, then Open room modes and Change room mode. The guest policy is kept (it comes from the pre-flight), but B's microphone lock is undone.
Both modes set the same settings, so the room's original values only change settings no mode sets. Suggestion: change only what the modes set; bring back the original value only for what the old mode set and the new one doesn't; keep everything else as it is. The summary should then show the room's current values.
There was a problem hiding this comment.
This changes the rule product set for a mode switch (the room as created + the new mode), so I took it back to product before changing it. I'll follow up here.
There was a problem hiding this comment.
Changed as you suggested, in f0db7f7 (the applier commit, now "bring back what only the previous room mode set") with fixups 6ef9e8b, 678842a, 805b877 and cc0cafb:
- A switch changes only what the new mode and the edits set.
- A setting the previous mode's preset set and the new one leaves out goes back to the room as created. Class and Meeting set the same settings, so that path has nothing to bring back yet.
- Everything else stays as the room has it: the guest policy, a lock set by hand (microphone, private chat…), and an edit applied with the previous mode. Both of your scenarios now keep them.
- The tab shows the room's current guest policy, and the pre-flight no longer passes the policy it showed along as an edit.
roomModeSwitch.spec.ts: the switch case now expects the hand-set guest policy and private chat lock to stay; it fails against the previous applier.
|
|
||
| this.setState({ roomModeApplying: true }); | ||
| try { | ||
| await this.roomModeApply(); |
There was a problem hiding this comment.
If a request of the change never gets an answer, the settings window gets stuck: Cancel stays disabled, Esc and the X don't close it, and no message appears. Only a page reload gets you out, and the room is left half changed. The pre-flight already protects the same applier with ROOM_MODE_APPLY_TIMEOUT; the tab could do the same and show the error.
Steps:
- Join as a moderator, pick Class and click Start room.
- In the browser console, run this to drop the room mode request:
const send = WebSocket.prototype.send;
WebSocket.prototype.send = function (data) {
if (typeof data === 'string' && data.includes('"operationName":"SetRoomMode"')) return;
return send.call(this, data);
};- Open Settings > Room modes, pick Meeting and click Change room mode.
- Wait a minute: the window stays open with Cancel disabled, and Esc and the X do nothing. Meeting's presentation policy was applied, but the mode is still Class.
There was a problem hiding this comment.
Done in 1e1846b: the tab now gives up after ROOM_MODE_APPLY_TIMEOUT (15 s), as the pre-flight does. The steps not yet sent are skipped, the change-failed notice shows, and the window unlocks, so Cancel, Esc and the X work again.
There was a problem hiding this comment.
Checked: after 15 s the notice shows and Cancel and the X work again. Esc only works after a click inside the window: "Change room mode" has the focus and gets disabled while applying, so the focus falls to the page. Could the focus go back into the window when the change fails?
There was a problem hiding this comment.
Done in 50ca606c64: when the change fails, the focus goes back to "Change room mode", or to the window itself if the button stays disabled, so Esc works without a click first. roomModeSwitch has a case for it: it drops SetRoomMode, waits for the change to be given up and presses Esc. On #26284 that case runs with the @nightly ones.
| <LockIcon aria-hidden /> | ||
| {intl.formatMessage(intlMessages.fixedHeading)} | ||
| </SummaryStyled.GroupHeading> | ||
| <SummaryStyled.Controls $locked={false}> |
There was a problem hiding this comment.
The switches under "Fixed for this session" look exactly like the ones you can change (same color), so they look clickable:
Passing $locked here would dim them like the pre-flight's locked controls, until BBBToggle has a disabled style.
To see it: Settings > Room modes, click the gear of Class and scroll down.
There was a problem hiding this comment.
Done in 0c5918f, with the library instead of $locked: bbb-ui-components-react 0.11.0 gives a disabled BBBToggle its own look (dimmed text and checked track, not-allowed cursor). The fixed switches already pass disabled, so they now look locked, and dimming them again with $locked would double it. The bump also reaches the poll and layout toggles, which only gain the disabled look and a visible focus outline.
|
This pull request has conflicts ☹ |
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.
Addresses the review on bigbluebutton#26188: - Skip the apply when another moderator is already in the room, and tell the moderator with a toast: a mode is never applied over a running room. - Apply only if the room still has no mode when the join lands; a mode another moderator set since Start room stays, with its own toast. - Leave public chat out of the applied settings in a room without chat. - Send the guest policy only when the moderator edited it. - Summary test: edit, Cancel, Start room, then read the whole room after the join, lock settings included. - Apply tests: count the held SetRoomMode, check what lands after the deadline, read the viewer's own lock, cover the guest policy, and scale the long waits with the suite's timeouts. - New cases: another moderator in the room, a mode set during the join, a room without chat, an edited guest policy. - Shared test helpers moved to roomMode.ts and roomModePanel.ts. - release-testing.md follows the specs.
The settings window scrolled as a whole, so a long tab took the tab list away with it. The window's body now holds to the window's height: the tab list stays put and only the selected tab's panel scrolls, with the scrollbar the chat and the other lists use. The library modal's body grows with its content, so it is let shrink to the window. The tabs are a little tighter, so the usual seven fit without a scrollbar on a 768 px high screen.
bbb-ui-components-react 0.9.0 (now on v4.1.x-develop) takes slotProps.input instead of inputProps, and puts aria-labelledby and aria-describedby on the input itself, so the two pointers go.
The bbb_pre_flight_room_modes row still said the pick is not applied.
Moderators could only pick a room mode in the pre-flight, before the room started, with no way to change it afterwards. The settings window gets a "Room modes" tab, after Data savings, for a moderator in the room with room modes on (not in breakout rooms). It works in two steps, as the design draws it: the mode cards, with the room's current mode marked and a gear beside each card, and a mode's settings, opened from its gear, with the same summary as the pre-flight in a card, settings fixed for the session (recording, breakout rooms, polls, reactions, virtual backgrounds) listed disabled, and "Back" or "Apply changes" to drop or keep the edits. "Apply changes" needs an edit that changes something. On that tab the window's footer offers "Change room mode" instead of Save, enabled when the pick differs from the room's mode or carries edits, and never while a mode's settings are open. It applies the pick with the applier, over the room as it was created, and says whether it changed; the window stays open on a failure. While it applies, the window stays on the tab and Cancel and closing wait for it. Settings changed in other tabs are saved along with it, as Save would; otherwise the window closes as Cancel does. A pending pick counts as an unsaved change: closing the window asks first, and so does Save from another tab, saying that only the pick is dropped and the other settings are saved. The window can also be opened on a given tab and with a pick already made. A tab that only shows once the user's data arrives, as this one does, is selected as soon as it shows.
A moderator whose pick the pre-flight did not apply, because another moderator was already in the room, was only told so: the pick was lost, and setting a mode meant starting over somewhere else. The notice now carries an "Open room modes" action that opens the settings window on the Room modes tab with that pick, its edits and the guest policy the pre-flight showed, already made, ready for "Change room mode". The notice stays until it is used or closed, and a click elsewhere on it does not close it, as with the other notices that carry an action. The action shows only while the sidebar's settings button, which takes the pick, is there: the notice comes before the room renders, and a layout may leave the button out.
roomModeSwitch.spec covers the Room modes tab: only moderators get it, and not with room modes off; switching applies the new mode over the room as created, dropping changes made by hand; an edited control wins over the preset, and nothing is changed while it is not kept; fixed settings show disabled and Back keeps nothing; a change needs another mode; Save and closing ask before dropping a pick; a reload or a second moderator applies nothing again; a pick the pre-flight skipped is picked up from the notice; and a viewer follows the switch. Absence checks sample the room's settings across the applier's 15-second deadline (expectRoomSettingsStable) rather than reading once after a fixed wait. The class and meeting settings and the hand-made mute from roomModeApply are shared with it.
The guest policy and presentation policy options, values and labels, were declared twice: in the lock viewers modal and in the room mode settings, which the pre-flight summary and the Room modes tab read. Both now come from lock-viewers/policy-options: the lock viewers modal renders its guest policy items and presentation policy items from it, with the same data-test ids and tooltips, and the room mode settings take their select options from it. The values, the labels and the default presentation policy do not change.
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.
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.
🚨 Automated tests failed |

What does this PR do?
Moderators can change the room mode during the session, from a new Room modes tab in the settings window. A switch applies the new mode's settings: a setting only the previous mode set goes back to how the room was created, and what no mode sets, such as the guest policy or a lock changed by hand, stays as it is.
roomBaseSettingscolumn keeps the room as created, written once by akka at insert.bbb-ui-components-react0.11.0 bringsBBBToggle'sfullWidth, which puts the summary's labels at the start and the switches at the end, and its disabled look, which the switches under "Fixed for this session" use.Stacked on #26188, #26180, #26113 and #26099; their commits sit below these.
In detail:
Closes Issue(s)
None
Motivation
A room mode could only be picked before the room started.
How to test
Turn on
public.app.preFlight.enabledandpublic.app.preFlight.roomModes.enabled. Create a meeting withlockSettingsDisablePublicChat=true&lockSettingsLockOnJoin=false&lockSettingsPresenterPolicy=freeForAll&webcamsOnlyForModerator=true&muteOnStart=false&record=true, join as a moderator, pick Class and click Start room.Automated:
pre-flight/roomModeSwitch.spec.ts(11 cases,@ci); the room mode specs pass locally on LiveKit.Known limits
muteOnStartThresholdabove 0, the server resets "join muted" whenever a user joins or leaves the audio, so a mode's setting does not last.SCREENSHOTS
room-mode-handoff.mp4
More
@cicases, and CI splits them into shards by count, so shards 2 and 8 ofinstall-and-run-bbb-testscan hit the 25-minuteRun testslimit 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@citests).Changelog
Technical — A
roomBaseSettingscolumn keeps the room as created, so a room mode switch brings back what only the previous mode set; modes apply from the pre-flight or a new settings tab.User-facing — Moderators can change the room mode during the session, from the settings window.