Skip to content

feat(audio): add deafenAudioUntilExplicitJoin setting to restore pre-3.0 close-modal behavior - #25393

Open
imdt-claudiop wants to merge 2 commits into
bigbluebutton:v3.0.x-developfrom
imdt-claudiop:feature/force-audio-join-on-close
Open

imdt-claudiop wants to merge 2 commits into
bigbluebutton:v3.0.x-developfrom
imdt-claudiop:feature/force-audio-join-on-close

Conversation

@imdt-claudiop

@imdt-claudiop imdt-claudiop commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Restores the pre-3.0 (2.7) behavior where the user does not join audio unless they explicitly choose to. Adds a new setting deafenAudioUntilExplicitJoin (boolean, default false).

When deafenAudioUntilExplicitJoin: true, the user joins the LiveKit bridge deafened at join time - they never hear audio until they explicitly click "Join audio" in the toolbar.

Closes #25346

Problem

In BBB 2.7, dismissing the initial audio modal let users stay in the session without any audio connection. In 3.0+ with LiveKit, the user is auto-connected to the bridge (muted) on entry (transparent listen-only), so closing the modal could not prevent the connection.

Thanks to @prlanzarin for the key insight that joining is not optional at the client level with LiveKit, and to @TiagoJacobs for the suggestion to deafen at join time and to rename the setting to reflect what it actually does.

Implementation

The user joins the LiveKit bridge deafened at join time when deafenAudioUntilExplicitJoin: true. The deafen is applied in AudioManager.onAudioJoin, the single chokepoint where isDeafened flips to false. An explicit "Join audio" action calls AudioManager.onAudioJoin({ deafened: false }) to re-enter the join flow, which runs all post-join steps (device setup, monitor, started event) exactly once and undeafens, reusing the existing bridge connection.

The auto-join that triggers the deafen decision is gated on a userSettingsReady signal, so it cannot fire on a stale default during the async graphql user-settings load window.

Changes

9 files, +120/-11:

  • private/config/settings.yml - new public.app.deafenAudioUntilExplicitJoin: false
  • imports/ui/Types/meetingClientSettings.ts - deafenAudioUntilExplicitJoin: boolean
  • imports/ui/core/initial-values/meetingClientSettings.ts - default false
  • imports/ui/services/audio-manager/index.js - onAudioJoin applies deafened based on the setting (unless requestAudioJoin was set); requestAudioJoin() method and flag
  • imports/ui/components/audio/audio-modal/container.jsx - reads useUserSettingsReady, threads to component
  • imports/ui/components/audio/audio-modal/component.jsx - auto-join useEffect early-returns until userSettingsReady; explicit join paths set requestAudioJoin
  • imports/ui/components/audio/audio-graphql/audio-controls/component.tsx - toolbar "Join audio" on a connected-but-deafened user calls onAudioJoin({ deafened: false }) (re-enters join flow, runs post-join steps)
  • imports/ui/components/custom-users-settings/component.tsx - sets userSettingsReady after applying GraphQL userdata
  • imports/ui/core/local-states/useUserSettings.ts - new userSettingsReady reactive signal

Validation

Validated on a BBB 3.0 from-source dev environment (LiveKit, media confirmed working) with Playwright. The authoritative signal is per-peer-connection WebRTC inbound-rtp stats (conference tracks) + AudioManager state instrumentation (spies on post-join methods):

Phase Test A deafenAudioUntilExplicitJoin=true Test B =false (default)
auto-join (first join) 0 conference tracks (deafened since join), post-join steps skipped 1 track, hearing, post-join steps ran
after explicit Join Audio 1 track, hearing, post-join steps ran exactly once (started, monitor, changeOutputDevice) 1 track, hearing

Build: bbb-html5/deploy.sh rc=0, served bundle carries deafenAudioUntilExplicitJoin + requestAudioJoin + onAudioJoin.

Known limitations

  • user_voice.deafened stays false in the DB for LiveKit users (pre-existing inconsistency - client-side deafen only for LiveKit). Tracked in follow-up issue user_voice.deafened DB mirror stays false for LiveKit users (client-side deafen only) #25406.
  • Mid-session breakout re-joins in audio/container.jsx are not gated on userSettingsReady (settings are long-loaded by then).
  • 21 pre-existing lint errors in audio-manager/index.js (identical count before this change; zero added).

Backward compatibility

Default is false - existing deployments see no behavior change. The default-path logic is byte-for-byte unchanged. Setting true is opt-in.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds configurable deafening until explicit audio joining. Audio joining tracks explicit user opt-in, automatic joining waits for user settings readiness, and audio controls, modal confirmation, echo-test approval, and modal closure apply the new behavior.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AudioModal
  participant AudioManager
  participant UserSettings
  User->>AudioModal: Explicitly join audio
  AudioModal->>AudioManager: requestAudioJoin()
  AudioManager->>UserSettings: Read deafening setting
  AudioManager->>AudioManager: Process audio join
  AudioManager-->>User: Audio enabled or deafened
Loading

Possibly related issues

  • #25346 — Adds the setting and modal-close behavior requested to avoid joining audio when the dialog is closed.

Suggested reviewers: prlanzarin, ffdixon, Tainan404

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR implements the requested setting and the intended close-modal audio behavior for #25346.
Out of Scope Changes check ✅ Passed The changed files all support the audio-setting flow or its readiness gating, with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly summarizes the main change: adding the deafenAudioUntilExplicitJoin setting to restore close-modal behavior.
Description check ✅ Passed The description is directly related to the changeset and explains the new setting and its audio-join behavior.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@TiagoJacobs

Copy link
Copy Markdown
Member

hello @imdt-claudiop

if we analyze this broadly, the popup now is understood as a microphone selection popup, and when you close this means "no microphone", and so, it joins in listen mode

the requested feature is that when a certain configuration flag is defined, we understand the modal close as "I don't want to join audio"

said that, instead of forceAudioJoinOnClose (that defaults to true), I think we should have something like skipAudioJoinOnModalClose

feel free to propose something different, if you find a better solution while analyzing - take your time

@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Good point - the current name describes the mechanism we want to disable, not the intent. skipAudioJoinOnModalClose (default false) is clearer: it reads as "allow the admin to make modal-close mean 'no audio at all'", and the default false is a safer opt-in for the restored behavior.

I'll rename across all 4 files, invert the gate logic (if (!skipAudioJoinOnModalClose && usingLiveKit && ...)), rebuild and re-validate. Will update the PR shortly.

@prlanzarin

Copy link
Copy Markdown
Member

hello @imdt-claudiop

if we analyze this broadly, the popup now is understood as a microphone selection popup, and when you close this means "no microphone", and so, it joins in listen mode

the requested feature is that when a certain configuration flag is defined, we understand the modal close as "I don't want to join audio"

said that, instead of forceAudioJoinOnClose (that defaults to true), I think we should have something like skipAudioJoinOnModalClose

feel free to propose something different, if you find a better solution while analyzing - take your time

Skipping the audio modal is not sufficient. Joining audio is not optional at the client level, it will be done regardless of whatever artifice is used at the modal/join level.
One correct approach for this right now is to supply the deafened=true parameter to the audioJoin callback of AudioManager so that the user is deafened at join time when this suggested config flag is active and the user closes the modal.

@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Thanks @prlanzarin - that is a relevant technical point.

Two things to untangle here:

  1. The rename (in progress) is independent of the join mechanism - skipAudioJoinOnModalClose vs forceAudioJoinOnClose is about naming/default, and I am applying it regardless.

  2. The deeper design question you raised - whether skipping the modal is sufficient at all, or whether we need to pass deafened=true to audioJoin so the user is deafened at join time. This changes the semantics of the feature: the issue (Restore ability to close audio dialog and not join the audio #25346) asks for "remain without any audio connection", while the deafened=true approach still joins the bridge but muted/deafened. These are different outcomes.

I want to validate your claim that "joining audio is not optional at the client level" against the current code before choosing the path. @TiagoJacobs - since you filed the original request, can you weigh in on which behavior is actually desired: (a) no audio connection at all, or (b) joined but deafened? And do you agree with the deafened=true approach if (b)?

Meanwhile I will trace the AudioManager / audioJoin callback to confirm whether a forced join happens regardless of the modal gate.

@imdt-claudiop
imdt-claudiop force-pushed the feature/force-audio-join-on-close branch from 4e94814 to 988b847 Compare July 9, 2026 17:44
@imdt-claudiop imdt-claudiop changed the title feat(audio): add forceAudioJoinOnClose setting to restore pre-3.0 close-modal behavior feat(audio): add skipAudioJoinOnModalClose setting to restore pre-3.0 close-modal behavior Jul 9, 2026
@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Updated per @TiagoJacobs feedback: renamed forceAudioJoinOnClose (default true) to skipAudioJoinOnModalClose (default false), inverting the semantics so the name describes the admin intent (allow modal-close = no audio) and the default is a safe opt-in.

Re-validated with Playwright: default (false) fires joinMic on close (3.0 preserved); override (true) blocks it (2.7 restored). Build rc=0, bundle contains the new key, old name fully removed. New demo in the PR body.

The deafened=true question from @prlanzarin is still open in the thread above - awaiting @TiagoJacobs position on which outcome is desired (no-audio-connection vs joined-but-deafened) before marking ready.

@imdt-claudiop
imdt-claudiop force-pushed the feature/force-audio-join-on-close branch from 988b847 to c0823e9 Compare July 10, 2026 04:10
@antobinary antobinary mentioned this pull request Jul 10, 2026
10 tasks done
@imdt-claudiop
imdt-claudiop force-pushed the feature/force-audio-join-on-close branch from c0823e9 to cb6d963 Compare July 12, 2026 03:55
@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

@prlanzarin Reworked the PR based on your suggestion - the user now joins deafened at join time instead of being deafened only on modal close.

The deafen is applied in AudioManager.onAudioJoin, which is the single chokepoint where isDeafened flips to false. When skipAudioJoinOnModalClose: true and the join was not an explicit user action (tracked via a new requestAudioJoin flag set by the toolbar button, settings confirmation, and echo-test), the user starts deafened. An explicit "Join audio" action overrides the deafen and un-deafens them on the existing bridge connection.

I validated the join-time behavior with per-peer-connection WebRTC stats. With skip=true, the user has 0 conference inbound tracks from entry through modal close; clicking "Join audio" brings up 1 track (hearing). The previous implementation had a window where the user heard audio while the modal was open - that is gone now.

Two open questions remain (noted in the PR body):

  1. The DB deafened mirror stays false for LiveKit users (client-side deafen only).
  2. The per-user userdata path may not deafen the very first transparent listen-only connect (async graphql load), while the server-wide setting is immediate.

I would appreciate your review when you have time.

@bigbluebutton bigbluebutton deleted a comment from imdt-claudiop Jul 12, 2026
@TiagoJacobs

Copy link
Copy Markdown
Member

hello @imdt-claudiop

The name skipAudioJoinOnModalClose makes sense given the goal, but looking at the actual implementation, it behaves more like deafenAudioUntilExplicitJoin. It might be worth renaming it to reflect what it really does.

About your question - good catch:

The DB deafened mirror stays false for LiveKit users (client-side deafen only).

It's important for this column to be filled in correctly, but this looks like a pre-existing inconsistency rather than something introduced by this PR - is that right? If so, could you open a follow-up issue describing the discrepancy? We can address it in the near future.

The per-user userdata path may not deafen the very first transparent listen-only connect (async graphql load), while the server-wide setting is immediate.

please make the audio join happen only after the settings were loaded - this will prevent bug reports

@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Three actions:

  1. Rename: agreed, skipAudioJoinOnModalClose describes the moment, not the behavior. Renaming to deafenAudioUntilExplicitJoin across all files (settings, types, AudioManager, container, localStorage key).

  2. DB deafened mirror: confirmed pre-existing (the akka/FreeSWITCH DeafenUserCmdMsg path does not apply to LiveKit users). I will open a separate follow-up issue describing the discrepancy so it can be tracked independently.

  3. Per-user userdata timing: implementing the gate so the audio join happens only after the user settings have loaded via graphql. This ensures the deafen decision is based on the actual setting value, not a stale default during the async load window.

Will update the PR once all three are in and re-validated.

…3.0 close-modal behavior

Add a client setting, deafenAudioUntilExplicitJoin (default false), that restores the pre-3.0 ability to end up with no audio unless the user explicitly opts into hearing it.

With LiveKit and transparent listen-only, the user is connected to the audio bridge on entry, before the modal is even closed, so the connection cannot be avoided at the client level. Instead of joining and then hearing audio, the user is deafened at join time: AudioManager.onAudioJoin honors the flag and starts the user deafened (receiving no audio) unless they explicitly opt in. Deafening at join time, rather than on modal close, closes the window where the user would briefly hear other participants while the modal is still open. The name describes what the setting does (deafen until an explicit join) rather than the moment it used to hook into.

An explicit "Join audio" action undeafens the user: the audio controls button, the audio settings confirmation and the echo test all call AudioManager.requestAudioJoin, which overrides the deafen-at-join-time behavior and reuses the existing bridge connection. Closing the modal is a no-op when the flag is on (the user is already deafened); when the flag is false the current 3.0 behavior is preserved (closing forces a muted join).

Gate the automatic audio join on user settings being loaded. getFromUserSettings falls back to defaults until the per-user settings finish loading from GraphQL, so an auto join that fires before then could read a stale default and leave the user undeafened. CustomUsersSettings now exposes a userSettingsReady signal, set once the settings resolve, and the audio modal defers its automatic join until it is true.

The behavior is scoped to LiveKit. The setting can be enabled server-wide via bbb-html5.yml or per-user via the bbb_deafen_audio_until_explicit_join userdata parameter.
@imdt-claudiop
imdt-claudiop force-pushed the feature/force-audio-join-on-close branch from cb6d963 to 2912287 Compare July 12, 2026 05:08
@imdt-claudiop imdt-claudiop changed the title feat(audio): add skipAudioJoinOnModalClose setting to restore pre-3.0 close-modal behavior feat(audio): add deafenAudioUntilExplicitJoin setting to restore pre-3.0 close-modal behavior Jul 12, 2026
@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Updated per the review:

  1. Renamed skipAudioJoinOnModalClose -> deafenAudioUntilExplicitJoin across all files (identifier, localStorage key, comments). Zero old-name references remain.

  2. Settings-load gate: added a userSettingsReady reactive signal (useUserSettings.ts), set true by custom-users-settings right after applying GraphQL userdata. The audio modal's auto-join useEffect early-returns until userSettingsReady is true, so the deafen decision cannot fire on a stale default. Validated: Test A (flag true) correctly deafens on the first auto-join (0 conference tracks), confirming the gate works during the async load window.

  3. Follow-up issue for the DB deafened mirror: opened user_voice.deafened DB mirror stays false for LiveKit users (client-side deafen only) #25406 describing the pre-existing LiveKit/DB inconsistency.

A/B re-validated with WebRTC stats. PR description updated with the new name and the settings-gate note.

@TiagoJacobs
TiagoJacobs marked this pull request as ready for review July 12, 2026 05:27
@TiagoJacobs
TiagoJacobs requested a review from prlanzarin July 12, 2026 05:27
@TiagoJacobs

Copy link
Copy Markdown
Member

hello @imdt-claudiop - this PR looks good to me

let's check if @prlanzarin have any additional concerns or comments, otherwise, we can merge it soon

@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Thanks @TiagoJacobs. Waiting on @prlanzarin for any final concerns before merging.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx (1)

423-438: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Undeafen the already-connected LiveKit case
requestAudioJoin() only takes effect on the next join. If deafenAudioUntilExplicitJoin has already connected the user in a deafened state, this branch just closes the modal and leaves them silent; mirror audio-graphql/audio-controls/component.tsx here by clearing AudioManager.isDeafened when isConnected && AudioManager.isDeafened.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx`
around lines 423 - 438, The connected branch of handleAudioSettingsConfirmation
must explicitly undeafen users already connected by LiveKit: when isConnected
and AudioManager.isDeafened are true, clear AudioManager.isDeafened before
closing the modal. Keep the existing join flow for disconnected users and
closeModal behavior for connected users.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bigbluebutton-html5/imports/ui/services/audio-manager/index.js`:
- Around line 778-802: The explicit undeafen path must execute the post-join
work currently skipped after a deafened entry. Update the flow around
onAudioJoin and the explicit join handling, such as requestAudioJoin, so
setDeafened(false) re-enters onAudioJoin or invokes the equivalent
changeOutputDevice, storeAudioInputDeviceId, microphone/listen-only selection,
monitor, and started audio event steps exactly once.

---

Outside diff comments:
In `@bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx`:
- Around line 423-438: The connected branch of handleAudioSettingsConfirmation
must explicitly undeafen users already connected by LiveKit: when isConnected
and AudioManager.isDeafened are true, clear AudioManager.isDeafened before
closing the modal. Keep the existing join flow for disconnected users and
closeModal behavior for connected users.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 22815cec-3438-43e3-b2cf-cdb6e7414aa7

📥 Commits

Reviewing files that changed from the base of the PR and between 4ad56e1 and 2912287.

📒 Files selected for processing (9)
  • bigbluebutton-html5/imports/ui/Types/meetingClientSettings.ts
  • bigbluebutton-html5/imports/ui/components/audio/audio-graphql/audio-controls/component.tsx
  • bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx
  • bigbluebutton-html5/imports/ui/components/audio/audio-modal/container.jsx
  • bigbluebutton-html5/imports/ui/components/join-handler/custom-users-settings/component.tsx
  • bigbluebutton-html5/imports/ui/core/initial-values/meetingClientSettings.ts
  • bigbluebutton-html5/imports/ui/core/local-states/useUserSettings.ts
  • bigbluebutton-html5/imports/ui/services/audio-manager/index.js
  • bigbluebutton-html5/private/config/settings.yml

@prlanzarin

Copy link
Copy Markdown
Member

I'll do a thorough review, not just a final concerns skim over this ;).

FWIW, on next similar approaches to issues, I'd prefer we planned/discussed the implementation BEFOREHAND in the issue before implementing it.

With deafenAudioUntilExplicitJoin enabled, clicking "Join audio" on a
deafened entry only flipped the isDeafened flag. The initial deafened
join returns early from onAudioJoin, so the post-join side effects
(output/input device selection, storeAudioInputDeviceId,
setUserSelectedMicrophone/setUserSelectedListenOnly, monitor and the
"started" audio event) were never run once the user opted in.

Re-enter onAudioJoin({ deafened: false }) from the explicit-join handler
so those steps run exactly once, reusing the existing bridge connection.
This matches onAudioJoin's documented contract of being called again when
the user is undeafened. The now-unused setDeafened helper is removed.
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Hello @prlanzarin - just checking in, no rush.

When you last commented you mentioned you'd do a thorough review of this PR. I wanted to gently follow up to see whether you've had a chance to look further, or if there's anything specific you'd like me to address in the meantime. Happy to incorporate any feedback you have.

@prlanzarin prlanzarin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this works. Partial review with inline suggestions and patches.

I still will look over https://github.com/imdt-claudiop/bigbluebutton/blob/8952de4a4ab5cccebe71b59fb185df9ed71c5ec5/bigbluebutton-html5/imports/ui/components/audio/audio-graphql/audio-controls/component.tsx#L96-L110 specifically, as the short-circuit there looks like it's a no op. The assumption that transparent listen only auto joins anything on entry is not correct on its own - it doesn't, not on modal closure with this flag on. I need to poke at it to see if there's any edge case I'm not seeing for that short-circuit to be necessary.

// consumers whose behavior depends on a setting being resolved (e.g. the audio
// auto-join deafen decision) should wait for it before acting on that setting.
const [useUserSettingsReady, setUserSettingsReady] = createUseLocalState<boolean>(false);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client entrypoint already wraps the whole app in CustomUsersSettings, which only renders children components when user settings have been fetched. i.e: I don't think AudioModal can ever be mounted while settings haven't been fetched.
I suggest removing this (alongside audio-modal/component.jsx:678, custom-users-settings/component.tsx:2,74-77, container.jsx:64,195) as it's basically dead code.

Comment on lines +785 to +788
const deafenAudioUntilExplicitJoin = getFromUserSettings(
'bbb_deafen_audio_until_explicit_join',
window.meetingClientSettings.public.app.deafenAudioUntilExplicitJoin,
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate deafen predicate fetch (audio-modal/container.jsx:63 and services/audio-manager/index.js:785-788). Better if it's centralized as it deals with hardcoded userdata and settings attribute names. Suggestion:

0002-refactor-audio-read-deafenAudioUntilExplicitJoin-via.patch

Comment on lines +96 to +104
// With deafenAudioUntilExplicitJoin the user may already be connected to the
// audio bridge but deafened (transparent listen-only connects on entry, and
// we deafen at join time). In that case joining audio just means undeafening
// - the connection already exists, so we reuse it instead of reopening the
// modal. We re-enter onAudioJoin (deafened: false) rather than only flipping
// the deafened flag: the initial deafened join returns early and skips the
// post-join steps (device selection, monitor, "started" event), so those must
// run now that the user opted in. onAudioJoin is idempotent for this path -
// the skipped steps run exactly once.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not high priority, but still: the inline comments in this PR are verbose, duplicate the same rationale in multiple places and are, sometimes, incorrect or incomplete (e.g: conflating LiveKit's logic of audio being opt-out with transparent listen only, which doesn't have much to do with it).

Inline comments are good, but it'd be better if they were as succint as possible. State the why and how in a way that cannot be further summarized, else we risk littering the codebase with comments folks will likely not read or parse adequately.

Suggestion:

0003-docs-audio-trim-deafenAudioUntilExplicitJoin-comment.patch

@prlanzarin prlanzarin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finalizing my partial review.

See my first comment: #25393 (comment). It meant that, server-side, the audio join state transition always happens - regardless of any skip done here.

One alternative suggested in that comment was to use the onAudioJoin callback
to enforce the deafened state server-side when skipping the audio modal - mainly due to the fact that the client side enforcement of deafened state depends on voice records being present in the server to work. That suggestion was extrapolated in subsequent commits here to apply to every join path in the client, which is not correct.

The main issue: with the bbb-webrtc-sfu bridge, audio join is only ignored when the join action itself is ignored by the user (i.e.: closing the modal) or autoJoin=false. This PR makes skipCheck flags also honor the deafen-on-join flag, meaning skipCheck=true + deafenAudio=true would leave the user out of audio. This is a deviation of the original semantics of skipCheck in bbb-webrtc-sfu bridges (and the LK bridge itself).

A better strategy is to rollback to a simpler solution and follow the suggestion above: enforce deafened state E2E when applicable (skipping audio modal, autoJoin=false). A cleaner approach to what I initially suggested is to just fix the userSetDeafened mutation effect to also track for the voice record presence before enforcing it.

See PR #25491 which supersedes this one. Feel free to either pick the commits there into this branch (and then close #25941), or migrate this discussion there. It also includes a table of the expected interaction of audio join flags to make things clearer.

@antobinary antobinary mentioned this pull request Aug 6, 2026
9 of 13 tasks
@antobinary antobinary mentioned this pull request Sep 1, 2026
12 of 14 tasks

This branch has not been deployed

No deployments
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.

Restore ability to close audio dialog and not join the audio

4 participants