Skip to content

fix(call): allow joining a WebRTC call without a microphone#608

Open
HexaField wants to merge 1 commit into
devfrom
fix/webrtc-join-without-mic
Open

fix(call): allow joining a WebRTC call without a microphone#608
HexaField wants to merge 1 commit into
devfrom
fix/webrtc-join-without-mic

Conversation

@HexaField

Copy link
Copy Markdown
Contributor

Summary

Users without microphone access were blocked from joining calls. The Join button was disabled whenever `stream.value.getAudioTracks().length === 0`, and `createStream()` threw hard when `getUserMedia({ audio: true, ... })` was denied. Net effect: anyone with the mic blocked at the OS / browser level (or who had revoked permission) was stuck on the join screen with a red "Audio is disabled — please enable a microphone in the browser to join the call" warning.

There's no architectural reason for that gate. SimplePeer accepts `stream: undefined`, the SFU join path just iterates the local stream's tracks (none = nothing to add), and every track-add path in `webrtcStore.ts` already guards on `localStream.value`.

Changes

  • `app/src/stores/mediaDevicesStore.ts` — `createStream()` now retries without audio on `NotAllowedError` / `NotFoundError` / `NotReadableError` / `OverconstrainedError`. If both attempts fail, the stream stays `null` and the audio/video toggles are reset to match.
  • `app/src/components/call/controls/JoinCallControls.vue` — Join button is disabled only while `streamLoading` is true. The audio warning is reworded from "Audio is disabled — please enable a microphone … to join the call" to "No microphone available — you can still join and listen, enable a microphone if you'd like to speak."

Test plan

  • `vue-tsc --noEmit` clean for the changed files (same pre-existing errors as dev)
  • Manual: deny mic permission in the browser → Join button is enabled, user joins as listener, can hear others, can later flip audio toggle if they regrant
  • Manual: grant mic + camera → no regression in the normal join flow
  • Manual: deny mic AND camera → Join button enabled, joins with no local media, receives remote streams

The join flow blocked users without mic access from entering a call at
all. `JoinCallControls.vue` disabled the Join button whenever
`stream.value.getAudioTracks().length === 0`, and `createStream()` threw
hard when `getUserMedia({ audio: true, ... })` was denied — so a user
with the mic blocked at the OS / browser level (or who'd revoked
permission) was stuck on the join screen with a red warning telling them
to enable a mic.

There's no architectural reason for that gate. SimplePeer accepts
`stream: undefined`, `SfuManager.join()` just iterates the local stream's
tracks (none = nothing to add), and every track-add path in
`webrtcStore.ts` already guards on `localStream.value`.

This change drops the gate and adds a graceful fallback chain:

* `mediaDevicesStore.createStream()` — on a `NotAllowed` /
  `NotFound` / `NotReadable` / `OverconstrainedError` from the first
  `getUserMedia` call, retry without audio. If that also fails (or if the
  user wasn't requesting video either), surface a `null` stream and reset
  the audio/video toggles to match.

* `JoinCallControls.vue` — the Join button is only disabled while the
  stream is still being acquired (`streamLoading`). The audio warning
  stays but is reworded to be informational: "you can still join and
  listen — enable a microphone if you'd like to speak" instead of "you
  cannot join."

The user experience is now: silent join works (listener mode), unmuting
later is one toggle away if they grant permission, and the failure mode
of "I can't get my mic to work, so I can't even hear anyone else" is
gone.
@netlify

netlify Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploy Preview for fluxsocial-dev ready!

Name Link
🔨 Latest commit 06b5b62
🔍 Latest deploy log https://app.netlify.com/projects/fluxsocial-dev/deploys/6a2a72acf494c70008467d10
😎 Deploy Preview https://deploy-preview-608--fluxsocial-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@HexaField, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 40 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: be9d2399-ddb7-4092-93b5-cd05135afb3d

📥 Commits

Reviewing files that changed from the base of the PR and between bc3bae2 and 06b5b62.

📒 Files selected for processing (2)
  • app/src/components/call/controls/JoinCallControls.vue
  • app/src/stores/mediaDevicesStore.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/webrtc-join-without-mic

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.

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.

1 participant