Repository navigation
fix(web): session timer + resume mic after screen lock (iOS) - #4
Merged
Merged
Conversation
Two session bugs, surfaced on iOS: - Timer never started: composeSession passed a hardcoded elapsed '0:00'. Track the recording start (first begin() gesture, reset when a new session binds) and render M:SS live from it (the rAF loop already redraws ~30fps). - Recording died after a screen lock: iOS Safari suspends (or 'interrupts') the AudioContext when the screen locks / the tab backgrounds, and nothing resumed it, so frames stopped for good on return. Add AudioCapture.resume() (resume the context when it isn't running) + LiveModeSession.resumeCapture(), called from both visibilitychange→visible and a pointer tap (iOS often needs a user gesture for resume() to take). Recording genuinely can't run while LOCKED (an OS limit for web pages) — this restores it on return. tsc clean; 219 vitest pass; net-silence canary 2/2; build ok. Lock behavior needs a real iPhone test after deploy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Two session bugs reported on iPhone (after the WASM-backend crash fix landed):
Timer never started
composeSessionpassed a hardcodedelapsed: '0:00'. Now tracks the recording start (firstbegin()gesture, reset when a new session binds) and rendersM:SSlive (the rAF loop redraws ~30fps).Recording stops after a screen lock
iOS Safari suspends (or non-standardly "interrupts") the
AudioContexton screen-lock / backgrounding; nothing resumed it, so frames stopped for good when the user returned. Added:AudioCapture.resume()— resumes the context when it isn'trunning.LiveModeSession.resumeCapture()— called fromvisibilitychange→visibleand a pointer tap (iOS often requires a user gesture forresume()to take).Recording genuinely can't run while the screen is locked (an OS limitation for web pages) — this restores it on return.
tsc clean · 219 vitest · canary 2/2 · build ok. Lock behavior needs a real iPhone test after deploy.
🤖 Generated with Claude Code