Skip to content

[4.0 port] fix(akka-apps): Allow Locked Users to See Moderator Voice State #25921 - #25938

Merged
antobinary merged 5 commits into
bigbluebutton:v4.0.x-developfrom
antobinary:port-25921-moderator-voice-state-40
Oct 2, 2026
Merged

antobinary merged 5 commits into
bigbluebutton:v4.0.x-developfrom
antobinary:port-25921-moderator-voice-state-40

Conversation

@antobinary

Copy link
Copy Markdown
Member

porting forward #25921 to BBB 4.0

paultrudel and others added 5 commits October 2, 2026 10:28
A voice session can be established before the user's meeting record
exists, as happens when media reconnects ahead of the client. Its voice
record then takes the default role and keeps it. When the user record is
created, bring the voice record's role in line with it.

(cherry picked from commit 73f2b63)
…e state

The row akka-apps sends when it no longer holds a user's voice record
reports VIEWER, so a moderator's role is taken from their cached row for
that event, as on 4.0. Adds unit tests for the voice-state gate.

(cherry picked from commit d440b58)

[antobinary: 4.0 already takes a moderator's role from the cached row, so
of the middleware change only the optional read of userRole is new here.
voiceActivity.ts keeps its 4.0 version, whose query does select the role.]
A voice state event that clears a user's state (leftVoiceConf) can report
VIEWER for a moderator, so the cached role decides for those. Any other
event carries the user's current role, which now stands: after a
demotion, the user's voice state follows the lock like any viewer's.

Recipients that were shown the user as a moderator and may no longer see
them get a row that ends the user's talking and unmuted state and carries
no name, so the indicator does not stay on screen at its last state.

(cherry picked from commit 1c1a034)
…ser list

With "see other viewers in the user list" locked, a locked viewer still
has the moderators on its user list and must keep receiving their voice
state. 3.0.38 withheld it: the voice state event carried no role, so the
middleware could not tell a moderator from a viewer, and the locked
viewer saw no talking indicator and a moderator muted while speaking.

Two tests in the "Lock viewers" group:

- a locked viewer sees a moderator's talking indicator and mute state,
  including a viewer who joins once the moderator is already unmuted;
- the exemption follows the speaker's role: another viewer's voice state
  stays hidden, shows once that viewer is promoted, and is taken off the
  screen again on demotion.

Both fail on 3.0.38 and pass with the preceding commits of this branch.
With only the akka-apps change deployed the first passes and the second
fails at the demotion step, which is the part the middleware handles.

The user list draws another user's mute state only as the glyph of the
avatar's ::after badge, with no attribute or text to select on, so
hasUserListMicState compares the computed style.

(cherry picked from commit 7de9dda)
The two tests picked from 3.0 in the previous commit assume the 3.0 user
list. On 4.0:

- the user list sits behind the sidebar button, so the viewers' pages
  open it before the list is counted or read;
- a row's actions open from its "more options" button, and menus closed
  earlier leave hidden items in the DOM, so promote and demote act on
  the visible item of the speaker's row;
- a row shows another user's microphone state as a toolbar entry with
  its own data-test (audioStateUnmuted, audioStateMuted), so
  hasUserListMicState selects on that instead of the computed style of
  the avatar badge. The client writes the muted one with a trailing
  space, hence the prefix match.

On v4.0.x-develop before this branch the first test already passes, as
4.0 has carried the speaker's role since c85d703. The second fails at
the demotion step: the locked viewer keeps the demoted user's talking
indicator. With the middleware change of this branch both pass.
@antobinary antobinary added this to the Release 4.0 milestone Oct 2, 2026
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 976bc610-4a2d-4102-a021-0620684d9518

📥 Commits

Reviewing files that changed from the base of the PR and between 04efe66 and bc7d4fa.

📒 Files selected for processing (7)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/HandlerHelpers.scala
  • bbb-graphql-middleware/internal/streaming_server/userVoiceState.go
  • bbb-graphql-middleware/internal/streaming_server/userVoiceState_test.go
  • bigbluebutton-tests/playwright/core/elements.ts
  • bigbluebutton-tests/playwright/user/lockViewers.ts
  • bigbluebutton-tests/playwright/user/user.spec.ts
  • bigbluebutton-tests/playwright/user/util.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

When a user joins with an existing voice session, the application updates the session role if it differs from the user's role. The streaming middleware now handles missing roles and sends cleared voice-state rows to recipients who lose access after a role change. New backend and Playwright tests cover voice-state visibility for locked and unlocked viewers, including moderator demotion and departure.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Redis
  participant Middleware as HandleUserVoiceStateEvtMsg
  participant LockedViewer
  participant UnlockedViewer
  Redis->>Middleware: Voice-state event after role change
  Middleware->>LockedViewer: Cleared voice-state row
  Middleware->>UnlockedViewer: Current voice-state row
Loading

Suggested reviewers: paultrudel, tainan404

Merge Risk: ⚪ Minimal · up to bc7d4

No actionable issue remains before merge. Browser behavior has not been verified at runtime.

Security Architecture Review

Security architecture risk: 🔵 Low · up to bc7d4

The reviewed controls tie voice-state visibility to meeting membership and trusted roles. No introduced security weakness is established, but delivery failure and recovery behavior for visibility revocation remain incompletely verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The examined disclosure surface is speaker voice activity and identifying metadata delivered to browser subscribers selected within the speaker's meeting, including locked viewers when the speaker is a moderator. The observed membership and cache-key checks constrain selection by meeting; atomic enforcement through delivery and the external event-transport boundary remain incompletely assessed.

Trust Boundaries and Controls

  • observed — Browser connection setup derives meeting and user identity from an authorization check using session credentials, while session-variable refresh obtains authorization state from akka-apps. The new join synchronization uses the registered role rather than a role supplied by a streaming recipient.

Resilience and Maintainability Implications

  • observed — Live voice-state delivery, including visibility-clearing frames, ignores TrySend's return value and then updates or removes the cached row. TrySend can fail when the channel is full, frozen or closed. Replay filters currently hidden rows, but the examined evidence does not establish reliable revocation delivery or client reconciliation after a missed clearing frame.

Hardening Proposals

  • proposed — Make the visibility-revocation contract explicit for backpressure, repeated transitions and reconnect recovery, including whether authoritative replay replaces previously displayed state. Verify that the chosen recovery mechanism clears stale rows when a clearing frame cannot be queued.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 6 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description states that the pull request ports issue #25921 to BBB 4.0. This directly relates to the changeset.
Title check ✅ Passed The title clearly identifies the main change: allowing locked users to see moderator voice state in the BBB 4.0 Akka application port.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 6 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🧪 Generate unit tests (beta)
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

🚨 Automated tests failed

@antobinary
antobinary merged commit 420e8ca into bigbluebutton:v4.0.x-develop Oct 2, 2026
34 of 35 checks passed
@antobinary
antobinary deleted the port-25921-moderator-voice-state-40 branch October 2, 2026 17:59
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