Skip to content

fix(#630): auto-recover microphone on track end with dashboard toast - #905

Open
Shan7Usmani wants to merge 6 commits into
shouri123:mainfrom
Shan7Usmani:fix/630-mic-track-auto-recovery
Open

fix(#630): auto-recover microphone on track end with dashboard toast#905
Shan7Usmani wants to merge 6 commits into
shouri123:mainfrom
Shan7Usmani:fix/630-mic-track-auto-recovery

Conversation

@Shan7Usmani

Copy link
Copy Markdown

Description

When a microphone is unplugged mid-meeting, the audio track ends silently and the MediaRecorder freezes. This adds automatic recovery by re-acquiring the microphone stream and reconnecting it to the audio graph, along with a dashboard notification.

Changes

  • offscreen.ts: Mic \onended\ handler now attempts auto-recovery instead of just logging
    • Sends \MIC_TRACK_ENDED\ message to background for dashboard toast
    • Re-acquires microphone via \getMicrophoneStream()\
    • Reconnects recovered stream to the audio graph
    • Re-attaches the \onended\ handler to the new tracks
    • Gracefully handles recovery failure (continues without mic)
  • background.ts: Added \MIC_TRACK_ENDED\ message handler that logs the event to the meeting timeline

Testing

  • TypeScript compiles clean (\ sc --noEmit)
  • Existing tests pass

Fixes #630

Shan7Usmani and others added 6 commits June 24, 2026 20:02
…icipant names

- Fix initials derivation in createTranscriptEntryHTML to use escaped speaker
- Use sanitizeDataAttr for data-* attributes instead of escapeHtml
- Consolidate duplicate escapeHtml: deprecate sanitize.ts version, keep domHelpers.ts canonical
- Harden getEmptyStateHTML and truncatedNoticeHtml with escapeHtml for defense-in-depth
- Add domHelpers.test.ts with XSS, attribute-context, and regression tests
- Update sanitize.test.ts to import escapeHtml from canonical source
- Remove redundant DOM mock from sanitize.test.ts

Audit result: 0 active XSS vulnerabilities across all 47 innerHTML assignments.
@Shan7Usmani
Shan7Usmani requested a review from shouri123 as a code owner July 25, 2026 07:42
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Thank You for Contributing to Late-Meet

Please ensure that:

  • the issue was assigned to you before opening this PR
  • the PR references the related issue
  • your changes follow repository contribution guidelines
  • the project builds successfully before submission

Unassigned, duplicate, or low-quality PRs may be closed.

Thank you for contributing 💙

@github-actions github-actions Bot added type:docs Type: Documentation type:code Type: Code change type:test Type: Test files security-review Requires security review before merge gssoc Official GSSoC contribution issue gssoc:approved GSSoC: PR approved and scored labels Jul 25, 2026
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Shan7Usmani, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0e1e1619-8eac-47e0-8b3b-a3984d9f63fe

📥 Commits

Reviewing files that changed from the base of the PR and between d216444 and bbd456e.

📒 Files selected for processing (8)
  • README.md
  • src/background.ts
  • src/dashboard.ts
  • src/manifest.json
  • src/offscreen.ts
  • src/utils/domHelpers.test.ts
  • src/utils/sanitize.test.ts
  • src/utils/sanitize.ts

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 added bug Something isn't working size/L type:design Type: Design / UI / UX (Optional bonus) type:testing Type: Testing (Optional bonus) labels Jul 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thank you @Shan7Usmani for your contribution to Late-Meet!

✅ Verified: You are assigned to the linked issue #630.

Please review any automated suggestions or code review comments that may appear below! We will review your PR as soon as possible!


Please consider starring the repository ⭐ to show your support!

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gssoc:approved GSSoC: PR approved and scored gssoc Official GSSoC contribution issue security-review Requires security review before merge size/L type:code Type: Code change type:design Type: Design / UI / UX (Optional bonus) type:docs Type: Documentation type:test Type: Test files type:testing Type: Testing (Optional bonus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Handle audio capture track end events dynamically by resetting recorder

2 participants