fix(participant): detect stalled chunk production during recording#766
Open
JorimTheuns wants to merge 1 commit into
Open
fix(participant): detect stalled chunk production during recording#766JorimTheuns wants to merge 1 commit into
JorimTheuns wants to merge 1 commit into
Conversation
The suspicious-chunk guard only counts chunks that arrive. When the browser suspends the page mid-recording (screen lock, backgrounding, camera seizing the mic), the recorder produces no chunks at all — or flushes a corrupt >1KB chunk on wake that resets the counter — so the recording dies silently. Seen in production: a 2-hour event where the transcript flatlined after 6:47 PM with only 'Unable to process this chunk' entries, and no alarm ever fired. Add a stale-chunk watchdog: if recording is active (not paused) and no chunk has been finalized for 4x the timeslice, trigger the existing interruption path (alarm + modal + telemetry). Also check immediately on visibilitychange -> visible since timers are throttled while hidden. Interruptions now carry a reason (suspicious_chunks | stalled_no_chunks) so the two failure modes land as separate PostHog error tracking issues. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Hi @JorimTheuns! Thank you for contributing to Dembrane ECHO! Before we consider your Pull Request, we ask that you sign our Contributor License Agreement (CLA). This is only required for your first Pull Request. Please review the CLA, and sign it by adding your GitHub username to the contributors.yml file. Thanks! |
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.
What
Adds a stale-chunk watchdog to
useChunkedAudioRecorder: if recording is active (not paused) and no audio chunk has been finalized for 4× the timeslice (2 min at defaults), the existing interruption path fires — alarm sound, interruption modal, wake-lock release, PostHog report. Avisibilitychange → visiblelistener runs the same check immediately when the participant returns to the tab, since intervals are throttled while hidden.Interruptions now carry a reason (
suspicious_chunks|stalled_no_chunks), reported as separate PostHog error-tracking issues and as a property onportal_recording_error, so the two failure modes can be tracked independently.Why
The suspicious-chunk guard (v1.17.0) only counts chunks that arrive. When the browser suspends the page mid-recording — screen lock, backgrounding, the camera app seizing the mic —
onstopnever fires, so no chunks arrive and the guard never trips. On brief wake-ups the recorder flushes one corrupt-but->1KB chunk, which uploads (shows as "Unable to process this chunk" in the transcript) and resets the suspicious counter.Production case (June 19, Android Chrome 149): transcript healthy until 6:47 PM, then a 2-hour flatline with three dead chunks and one 3-second fragment — no alarm, nobody in the room knew. PostHog error tracking shows the sibling iOS mode ("consecutive suspicious chunks", issue, 23 users in 10 days) but the stalled mode was invisible by construction.
Notes
startRecordingand on resume-from-pause; watchdog skips while paused; fires at most once per session (sharedhasCalledInterruptionCallbackRef).triggerInterruption()— behavior unchanged.tsc --noEmitclean;biome lint --diagnostic-level=errorclean on both files (one pre-existing format nit on an untouched line inParticipantConversationAudio.tsxis also present onmain).🤖 Generated with Claude Code