Skip to content

fix(breakouts): user list not updating - #22987

Merged
lfzawacki merged 4 commits into
bigbluebutton:v4.0.x-releasefrom
germanocaumo:breakouts-users-update
Mar 2, 2026
Merged

lfzawacki merged 4 commits into
bigbluebutton:v4.0.x-releasefrom
germanocaumo:breakouts-users-update

Conversation

@germanocaumo

@germanocaumo germanocaumo commented Apr 22, 2025 •

Copy link
Copy Markdown
Contributor

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.

@coderabbitai

coderabbitai Bot commented Apr 22, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

This 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 getUser is replaced with getUsersSubscription, and the ordering criteria in the query are reduced to only nameSortable, registeredAt, and userId. The state management logic for initializing and synchronizing userAssignedRooms is updated to perform incremental updates (adding new users, removing absent users) rather than strict re-initialization. Minor formatting adjustments are also made to empty function bodies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • queries.ts: The GraphQL operation change from query to subscription requires verification that the schema change is correct and that removed ordering criteria do not impact functionality elsewhere.
  • component.tsx: The subscription wiring and casting of subscription data (usersData ?? [] to BreakoutUser[]) needs verification for type safety and correctness.
  • room-managment-state/component.tsx: The new merge logic for userAssignedRooms requires careful review to ensure it correctly handles user additions, removals, and state preservation across re-renders.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main fix: enabling user list updates in the breakout creation modal by switching from a query to a subscription.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description accurately describes the core change: converting from a user query to a subscription to enable real-time updates for the user list in the breakout creation modal.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 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.

@sonarqubecloud

Copy link
Copy Markdown

@antobinary antobinary added this to the Release 3.1 milestone Apr 22, 2025
@gustavotrott

Copy link
Copy Markdown
Contributor

FYI: It was implemented as query to avoid creating subscriptions fetching all users in scenarios with hundreds of users in the room.
In short: performance reasons

@germanocaumo

Copy link
Copy Markdown
Contributor Author

FYI: It was implemented as query to avoid creating subscriptions fetching all users in scenarios with hundreds of users in the room. In short: performance reasons

@gustavotrott does this performance is impactful? the breakout creation modal stays open for a short period of time, and just for the moderator..

@gustavotrott

Copy link
Copy Markdown
Contributor

FYI: It was implemented as query to avoid creating subscriptions fetching all users in scenarios with hundreds of users in the room. In short: performance reasons

@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 jsonPatch to minimize the payload, like in this example:

@germanocaumo

germanocaumo commented Apr 24, 2025 •

Copy link
Copy Markdown
Contributor Author

@gustavotrott ok, I should use the useSubscription from

@sonarqubecloud

Copy link
Copy Markdown

@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

🧹 Nitpick comments (1)
bigbluebutton-html5/imports/ui/components/breakout-room/create-breakout-room/queries.ts (1)

45-60: Consider removing registeredAt from 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 registeredAt may not be necessary—only nameSortable and userId for 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

📥 Commits

Reviewing files that changed from the base of the PR and between 284ab89 and c9e6099.

📒 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[]}

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.

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
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.

@github-actions

Copy link
Copy Markdown

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

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.
@github-actions

github-actions Bot commented Feb 6, 2026

Copy link
Copy Markdown

🚨 Automated tests failed

@sonarqubecloud

sonarqubecloud Bot commented Feb 9, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Feb 9, 2026

Copy link
Copy Markdown

✅ Automated tests have passed!

@lfzawacki
lfzawacki requested review from gustavotrott and removed request for gustavotrott February 13, 2026 17:28
@ramonlsouza
ramonlsouza self-requested a review March 2, 2026 13:29
@gustavotrott
gustavotrott removed their request for review March 2, 2026 17:47
@lfzawacki
lfzawacki merged commit e6f186b into bigbluebutton:v4.0.x-release Mar 2, 2026
32 checks passed
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.

5 participants