feat(app): increase offline sync chunk size from 1 to 3 minutes#8928
Merged
Conversation
Bump sdcardChunkSizeSecs 60 -> 180 for device-to-phone storage sync (SD card, ring, and offline storage WALs). Larger chunks mean 3x fewer hard file-boundary cuts (which slice words mid-utterance since chunking is by frame count, not VAD), more context per STT request, and 3x fewer upload/VAD/STT/Firestore round trips per hour of audio. Conversation grouping is unchanged: contiguous chunks have ~zero gap at boundaries, so the backend's +/-2 min closest-conversation lookup merges them into the same conversation either way. 180s stays well under the backend's 300s VAD/STT segment cap. The phone-side live WAL buffer (chunkSizeInSeconds) intentionally stays at 60s since it holds frames in memory before flushing.
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.
Summary
sdcardChunkSizeSecsfrom 60 → 180 inapp/lib/services/wals/wal.dart— the chunk size used when audio is synced from device storage to the phone (SD card, ring, and offline storage WALs; all consumers derive frame counts from this constant).chunkSizeInSeconds) intentionally stays at 60s, since it holds frames in memory before flushing — tripling it would triple audio lost on a crash.Why
SYNC_MAX_VAD_SEGMENT_SECONDS).Trade-offs (accepted)
Test plan
phone_mic_wal,local_wal_sync,wal_recovery,session_wal_sync,sync_response_handling,sync_rate_limit_reconciliation,wal_sync_display_state,wal_upload_resilience).flutter analyze lib/services/wals/— no new findings (only pre-existing infos/warnings).🤖 Generated with Claude Code