Repository navigation
fix(breakouts): user list not updating - #22987
Conversation
WalkthroughThis pull request refactors the user data fetching mechanism in the breakout room creation component from a query-based approach to a subscription-based approach. The GraphQL operation Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 |
|
|
FYI: It was implemented as query to avoid creating subscriptions fetching all users in scenarios with hundreds of users in the room. |
@gustavotrott does this performance is impactful? the breakout creation modal stays open for a short period of time, and just for the moderator.. |
Maybe not. It seemed reasonable to avoid introducing a subscription with large payload, especially since this approach was already used in BBB 2.7 — so we just kept it. But it might be worth reconsidering if the real-time updates justify the heavier payload. It's a trade-off. I only added the comment to explain why it was implemented as a query in the first place. I don’t have a strong preference either way. We should just ensure it uses |
|
@gustavotrott ok, I should use the |
c5984b3 to
c9e6099
Compare
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/queries.ts (1)
45-60: Consider removingregisteredAtfrom ordering.The subscription definition looks correct and appropriately filters bots. However, as noted in previous review feedback, for the breakout room creation context, ordering by
registeredAtmay not be necessary—onlynameSortableanduserIdfor stable, alphabetical sorting.Consider simplifying to:
order_by: [ {nameSortable: asc}, - {registeredAt: asc}, {userId: asc} ]) {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/component.tsx(5 hunks)bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/queries.ts(2 hunks)bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/room-managment-state/component.tsx(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-05-09T14:36:13.418Z
Learnt from: gustavotrott
Repo: bigbluebutton/bigbluebutton PR: 23137
File: bbb-graphql-server/bbb_schema.sql:2022-2027
Timestamp: 2025-05-09T14:36:13.418Z
Learning: User acknowledged that adding an ORDER BY clause to the DISTINCT ON query in v_breakoutRoom_commonProperties view makes sense but deferred implementation since "startedAt" values are mostly the same for all rooms.
Applied to files:
bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/queries.ts
📚 Learning: 2024-10-10T12:15:03.265Z
Learnt from: jaapjansma
Repo: bigbluebutton/bigbluebutton PR: 21204
File: bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala:21-21
Timestamp: 2024-10-10T12:15:03.265Z
Learning: When reviewing code changes in BigBlueButton, particularly in case classes like `RegisterUser` in `MeetingsManagerActor.scala`, ensure to accurately distinguish between added parameters and replaced parameters to avoid incorrect assessments.
Applied to files:
bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/room-managment-state/component.tsx
🧬 Code graph analysis (2)
bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/component.tsx (2)
bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/queries.ts (1)
getUsersSubscription(45-60)bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/room-managment-state/types.ts (1)
BreakoutUser(3-3)
bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/room-managment-state/component.tsx (1)
bigbluebutton-html5/imports/ui/components/presentation/container.jsx (1)
users(117-117)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-package (bbb-html5)
🔇 Additional comments (2)
bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/room-managment-state/component.tsx (1)
188-209: LGTM! Incremental synchronization is appropriate for subscription-based data.The refactored logic correctly handles dynamic user list changes by:
- Adding new users with empty assignment arrays
- Removing users no longer present
- Preserving existing room assignments
This is the right approach for the subscription-based data flow introduced in this PR.
bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/queries.ts (1)
108-109: LGTM!The export correctly reflects the change from query to subscription.
| setUpdateUsersWhileRunning={setUpdateUsersWhileRunning} | ||
| isBreakoutRecordable={currentMeeting?.breakoutPolicies?.record ?? true} | ||
| users={usersData?.user ?? []} | ||
| users={(usersData ?? []) as BreakoutUser[]} |
There was a problem hiding this comment.
Critical: Incorrect data access path for subscription.
The subscription getUsersSubscription returns data with structure { user: [...] }, but the code treats usersData as if it's directly an array. This will result in an empty users list, breaking the breakout room creation feature.
Apply this diff to fix the data access:
- users={(usersData ?? []) as BreakoutUser[]}
+ users={(usersData?.user ?? []) as BreakoutUser[]}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| users={(usersData ?? []) as BreakoutUser[]} | |
| users={(usersData?.user ?? []) as BreakoutUser[]} |
🤖 Prompt for AI Agents
In
bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/component.tsx
around line 787, the subscription returns an object shaped { user: [...] } but
the code passes usersData as if it were the array; change the prop to pass the
inner array by using (usersData?.user ?? []) as BreakoutUser[] so the component
receives the actual users array from the subscription.
|
This pull request has conflicts ☹ |
Change user query to subscription so the user list is updated when users join/leave after the creation modal is open. Removed some order by fields.
c9e6099 to
f9bc698
Compare
🚨 Automated tests failed |
|
✅ Automated tests have passed! |



What does this PR do?
Change user query to useUsersBasicInfo subscription instead so the user list is updated when users join/leave after the breakout creation modal is open.