Skip to content

Flutter transcription: phone-mic audio has no backup once it is sent #20366

Open

Description

@Itaxh1

TL;DR: Live phone-mic audio is marked "synced" the moment it's sent over the socket, so the app keeps no backup of it. If the server never saves the text, there's nothing to resend. Last week 495 phone-mic recordings sent audio and never got any text back: 101 of them were longer than 30 seconds, about 12 hours of audio in total. None had a connection error, so no repair ran. The phone mic should keep its frames until the transcript confirms them, as #19199 already does for the pendant. A fix with tests is ready; a PR will follow.

Product impact

  • Primary loop layer: Capture
  • Involves data loss: phone-mic speech the server didn't save has no local copy to recover from.

Describe the bug

To reproduce (replay-world test with the real CaptureController and LocalWalSyncImpl, a scripted socket and the fake native mic)

  1. Record 200 s of phone-mic audio with the socket connected.
  2. The server closes the conversation with a transcript that covers only seconds 1–20.
  3. Look at the phone's WALs.

Current behavior

No WAL exists for the session; none of the uncovered 180 seconds can be recovered.

Expected behavior

The phone keeps the audio until the transcript confirms it, then releases what is covered and uploads the rest for repair.

Since when

#5995 (merged 2026-03-28) added the phone-mic WAL with "mark synced on send". It affects all app versions.

Impact, last 7 days (PostHog Recording Completed, recording_source = 'phone_mic_live', 2026-09-25 to 2026-10-02)

Recordings Audio
All live phone-mic recordings (iOS 1,327, Android 710, iPadOS 9) 2,046 ~904 h
Audio sent, no text ever came back (iOS 229, Android 265, iPadOS 1) 495 ~13 h
… of which 30 s or longer 101 ~12 h
… of which 10 min or longer 10 ~8.5 h
  • All 495 had socket_error_count = 0, so the app's repair path never ran and no local copy exists.
  • Some of the short ones may be silence (the phone in a pocket, nobody talking).
  • PostHog can't count partial loss, where some text arrived and some didn't.

Proposed fix (tested locally)

  • Stop marking phone frames synced on send. They're then stamped and released by the same transcript confirmation as the pendant, with the coverage check from Flutter transcription: a partial transcript deletes the pendant's whole audio backup #20364.
  • Storage cost: phone audio is PCM16 at 16 kHz, about 1.9 MB/min (about 115 MB per hour of recording). It is held on disk until the conversation is confirmed, then deleted.
  • Upload cost: only audio the transcript doesn't cover is uploaded. That's heavier than the pendant's Opus (about 2.9 MB per 90 s). Encoding the backup as Opus would cut it and could be a follow-up.

Verification

  • The scenario test fails on main (0 s recoverable) and passes with the fix.
  • The existing capture, WAL and sync tests (949) and the full app suite (3,904 passed, 0 failed) pass.
How the PostHog numbers were measured

Recording Completed events from the last 7 days with recording_source = 'phone_mic_live', transcript_observed = false, audio_observed = true and socket_bytes_submitted > 0, bucketed by duration_seconds and split by socket_error_count. Here, transcript_observed means the app saw at least one live transcript segment during the recording.

Additional context

Activity

  1. added
    bug
    flutter
    on Oct 2, 2026
  2. added
    capture
    p1
    p0
    and removed
    capture
    p1
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcaptureflutterp0transcription

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions