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.
Thanks, the six layers line up, the moderator check is in both graphql-actions and akka, and the id pattern matches in TS and Scala. I deployed the branch on a dev server and ran pre-flight/roomMode.spec.ts: 4/4, 12/12 with --repeat-each=3, and the whole pre-flight/ folder passes. I also tried the edge cases by hand through the Apollo client; results are in the inline comments.
Before the configuration panel and the code that applies the mode build on this, I'd like to settle two things, plus one question:
-
Two moderators can both configure the room. The write is unconditional, and the mutation answers
truebefore akka runs. With two joined moderators in a room at'', sendingclassandmeetingback to back returnstruetwice and leavesmeeting, with nothing telling the first one. Two moderators who open the pre-flight together will both read'', both get the panel and both apply a preset.
Could the command take an optional expected value (sayexpectedRoomMode), checked in the handler, so the first claim wins? The client would claim with''first and apply its preset once its own claim shows up. That needs who set it next to the mode, since two moderators picking the same mode would otherwise both see "their" value. If last-writer-wins is fine, let's say so in the description.
Related:''is accepted, so any moderator can reopen the gate for everyone who arrives after them. Is clearing needed? -
The pre-join read can reuse
userCurrentSubscription. The pre-flight already subscribes touser_current { meeting { … } }throughuseCurrentUser, and bothuserCurrentSubscriptionandPatched_userCurrentSubscriptionare allowlisted. On the dev server, a viewer still on the pre-flight getsroomModethrough it, plus a push on every change.
AddingroomModeto thatmeetingblock (and to the comparator inuserComparator.ts) gives one read path that works before and after joining, with no new allowlist entry. As it stands,getRoomModehas no client document, and the client's patched hooks would sendPatched_getRoomMode. The middleware drops that before join without an error: I got no answer, for both a query and a subscription.
TheroomModeadded toMEETING_SUBSCRIPTIONcan't be read before join, so it doesn't cover the pre-flight. It's still the right source once joined (the in-room settings, and plugins, whose meeting data comes fromuseMeeting), so I'd keep it there and add theuser_currentread for the pre-flight only. -
Question: where should the next room-level settings go?
MeetingDbModelis now at 22 fields, the Scala 2 tuple limit. That's fine today, and the file already shows the way out (bridges,systemColumns). But if the follow-up settings get a table of their own,roomModecould start it, and room configuration would live in one place.
One correction to the description: "Akka drops the command silently" for a moderator who hasn't joined holds only while ejectOnViolation is off, which is the default. With it on, RegisteredUsers.eject flags the registered user even though they never joined (UsersApp.ejectUserFromMeeting), and their join then fails with "User had ejected". So the code that applies the mode should start from the server's joined state, not from the join call returning.
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
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
|
@germanocaumo, on the question in your first review, whether clearing the mode ( I also updated the description: the pattern no longer allows empty, and the authorization note now includes your |
|
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).
🚨 Automated tests failed |
What does this PR do?
A room-level mode id carried by the meeting. An empty value means "not configured". Every client can read it, including users still on the pre-flight screen, and a moderator can write it with
meetingSetRoomMode. No UI yet.How
SetRoomModeCmdMsgandRoomModeChangedEvtMsg.MeetingStatus2xmirror and a new handler. It only accepts moderators and rejects breakout rooms, likeMuteMeetingCmdMsgHdlr. It re-validates the id, ignores unchanged values, writes the newmeeting."roomMode"column and broadcastsRoomModeChangedEvtMsg.AnalyticsActorlogsRoomModeChangedEvtMsg.meeting."roomMode"(varchar(32), default''), exposed inv_meetingtobbb_clientandbbb_client_not_in_meeting, plus themeetingSetRoomModeaction.meetingSetRoomModehandler: moderator only, refused in breakout rooms (akka keeps its own check); id must match^[a-z][a-z0-9-]{0,31}$. Empty is only the column's default and cannot be set back, so no moderator can reopen the pre-flight panel for later arrivals.roomModein the meeting type,MEETING_SUBSCRIPTIONand the meeting comparator, and in theuser_currentmeeting block anduserComparator(which keepsundefinedand''apart).pre-flight/roomMode.spec.ts(@ci), using the existing Apollo probe.queryDocumentgets an optional operation name, andrunMutationreturns a rejected call as errors.Design notes
user_current { meeting { roomMode } }, which the middleware already lets through before joining and which pushes every change, so no new allowlist entry is needed.MEETING_SUBSCRIPTIONstays the source once joined (in-room settings, plugins)./api/rest/meetingStaticDatacan't serve it: nginx caches it for 24h per meeting.bbb-graphql-actions; the Hasura role inactions.yamlis not consulted there. A moderator who hasn't joined yet getstrueback and Akka drops the command, the same as every moderator action: silently with the defaultejectOnViolation=false; with it on,RegisteredUsers.ejectflags the registered user and their join then fails with "User had ejected". The applier must call only after the server confirms the join (user_current.joined).Known limits
MeetingDbModelis at 22 fields, the ceiling of the Scala 2tupledmapping. The mode lives in a nestedroomConfigprojection (MeetingRoomConfigDbModel), likebridgesandsystemColumns, so Phase 2 room settings go into that group without adding fields. The SQL column staysmeeting."roomMode".Two moderators who reach an unconfigured room together race: both read
'', both may set a mode, and the last write wins. This is known and deferred: the fix proposed in review (a claim with an expected value and who set it) will come with the code that applies a mode.How to test
bbb-graphql-server/bbb_schema.sqland the Hasura metadata, then restartakka-bbb-apps,bbb-graphql-actionsandbbb-graphql-middleware.bigbluebutton-tests/playwright:npx playwright test pre-flight/roomMode.spec.ts --project=chromium --workers=1.The 7 cases cover: a moderator sets the mode and another client reads it; a client still on the pre-flight reads it (and
user_current.joinedisfalse); a viewer is refused (Permission Denied (not moderator)); a moderator still on the pre-flight getstruebut nothing changes until they join; a moderator in a breakout room is refused; invalid ids (Class, 33 characters) are refused; the value survives a moderator reload. Without the Apollo probe (allowOverrideClientSettingsOnCreateCall), the cases skip.Evidence: 7/7, and 21/21 with
--repeat-each=3. RED on the unmodified base (field 'roomMode' not found in type: 'meeting';meetingSetRoomMode: Internal Server Error). html5 and suite eslint/tscare clean; Akkaclean compileis clean.