feat: keep screen awake on mobile devices during active calls - #722
Merged
Merged
Conversation
Request a screen wake lock while the user is in at least one call so mobile devices don't sleep and drop the call. The browser releases the lock when the page is hidden, so it is re-acquired when the page becomes visible again. Browsers without the Wake Lock API are unaffected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
birme
approved these changes
Oct 5, 2026
birme
left a comment
Contributor
There was a problem hiding this comment.
LGTM — reviewed as part of daily-backlog-pr Phase 3.5 orphan-PR housekeeping (full code-reviewer pass on a clean clone; npm ci/lint/typecheck/test all green, 327 tests incl. 5 new wake-lock tests).
Correct Wake Lock API usage, graceful feature-detection, cleanup on unmount, re-acquire on visibilitychange, and a StrictMode-safe cancelled guard. No blocking issues.
One non-blocking note for a follow-up (not gating this merge):
src/hooks/use-wake-lock.ts:16— under two visibilitychange events firing before the firstrequest("screen")resolves, an earlier sentinel could leak (only the last is stored). Normal visible/hidden transitions fire once each, so impact is low; anacquiringboolean before the await would close it. A test for the request-rejectscatchbranch would round out error-path coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Request a screen wake lock while the user is in at least one call so mobile devices don't sleep and drop the call. The browser releases the lock when the page is hidden, so it is re-acquired when the page becomes visible again. Browsers without the Wake Lock API are unaffected.