Repository navigation
Conversation
Phone-mic frames were marked synced as soon as they were sent, so nothing was written to the WAL while the socket was connected, and audio the server lost could not be recovered. Keep them until transcript confirmation, as pendant frames already are. A stopped phone recording has no active recording id by the time the server closes its conversation, so the stamp found every WAL foreign and left it unstamped, to be uploaded again without a conversation. The stamp now falls back to the recording id the WAL store last bound. Closes BasedHardware#20366
|
@cubic-dev-ai review |
@Itaxh1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Writing, stamping and releasing copies touch real files outside the virtual scheduler, so the scenarios wait for the WAL state they assert.
With phone frames kept until transcript confirmation, the frame bit that once released a sent frame also fed the capture screen, so a healthy recording read as "Uploading audio" with a growing "saved locally" total. The bit now only records that a live socket took the frame (markFrameStreamed). It no longer decides whether a chunk is stored or born synced: every live chunk is kept as a miss until a transcript confirms it. The in-flight count and the session window leave out streamed audio, so the indicator and its pending count show only audio at risk. The changelog no longer promises that recordings cannot be lost, and the scenario waits now also require the saved index to match.
|
@cubic-dev-ai review |
@Itaxh1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
The stamp fell back to the recording id the WAL store last bound, which is stale once a newer recording binds before the server closes the stopped one's conversation: its WALs then read as foreign and stayed unstamped. The stamp now takes the id on the session's earliest unstamped WAL, so the controller is back to main's stamp code. A chunk that joins an existing WAL now carries the streamed run only when the socket took every earlier frame, so a fully streamed copy is not shown as at risk. The changelog leads with the benefit.
|
@cubic-dev-ai review |
@Itaxh1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…its window began under With no active recording id, the stamp took the id on the window's earliest unstamped WAL. Once the stopped recording's own copies had uploaded, that could be a newer recording's WAL, which then got stamped with the older conversation. The store now records when it binds each recording, and the stamp uses the binding at the window's start.
|
@cubic-dev-ai review |
@Itaxh1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
… them on logout Rebinding the same recording no longer pushes the binding a window started under out of the history, and logout clears the history with the account's WALs.
|
@cubic-dev-ai review |
@Itaxh1 I have started the AI code review. It will take a few minutes to complete. |
|
Reviewed the full diff on 293423b — this is a well-built fix for a real data-loss bug (#20366), and the design matches the contract pendant audio already has since #19199. Per-file notes:
One awareness point for the maintainer sign-off: streamed phone-mic audio now persists on disk until the transcript confirms it, and unconfirmed copies are deliberately exempt from the auto-remove retention sweep ( Also noting the Dart/mobile suites were skipped in CI on this head, so the (good-looking) tests haven't machine-run here; they were reviewed statically. Thanks @Itaxh1 — the diagnosis (495 recordings / ~12h of audio lost last week) and the fix quality are excellent. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Confirmed bug (phone-mic backup loss, closes #20366) and well-tested, but mergeStateStatus is DIRTY (real conflict) and diff is 803 lines — approve-only, not merging; author/sibling-PR stack needs to resolve conflicts (policy forbids rebasing the branch ourselves).
|
Tested this end to end on the iOS Simulator against the local backend, with a small proxy that accepts
The branch now conflicts with |
|
@Itaxh1 this conflicts with |
TL;DR: Live phone-mic audio was marked as synced the moment it was sent over the socket, so the app kept no backup of it. If the server never saved the text, the recording was gone (#20366). Last week 495 phone-mic recordings sent audio and never got text back: 101 of them were longer than 30 seconds, about 12 hours of audio. Now phone frames stay in the WAL until the transcript confirms them, as pendant frames have since #19199, and audio the server didn't transcribe is uploaded for repair. The capture screen still shows only audio at risk, so a healthy recording doesn't read as "Uploading audio". App only, no backend change.
What changed and why
Closes #20366
synced). That is how sent phone audio lost its backup.markFrameSyncedis renamedmarkFrameStreamed.LocalWalSyncImpl._chunkandfinalizeCurrentSessionkeep every live chunk as amissuntil the transcript confirmation the pendant uses releases it. A send can no longer drop or confirm audio.getSessionWals,getSessionUnsyncedWals) leave out a copy the socket took in full (syncedFrameOffset == totalFrames), so a healthy recording shows no "Uploading audio" or "Audio saved locally" line, and no pending count. Audio captured while the socket was down still shows.activeRecordingIdis null, so the recording-id check that fix(sync): bind safety WALs to live recording intervals #19424 added treated every WAL as foreign, left it unstamped, and it would have been uploaded again without a conversation. This went unnoticed only because phone recordings had almost no WALs.stampConversationIdnow uses the recording the WAL store was bound to when the window began: the store records each binding and its time. That holds even if a newer recording binds before the close, and even if the stopped recording's own copies have already uploaded (both found by cubic's review). Rebinding the same recording doesn't push that binding out of the history, and logout clears the history (also from cubic). The controller's stamp code is unchanged from main.Costs and known limits
Recording Completed.socket_error_countis 0 on every recording. Uploading only the uncovered audio after an interruption, or encoding the backup as Opus, would cut this and could be a follow-up.Product invariants affected
none
How it was verified
flutter test test/services/capture/capture_phone_mic_backup_test.dart: 5 passed. Onmainwithout the fix:test/unit/*wal*|*capture*|*sync*|*transcri*|*recording*|*segment*,test/services/capture,test/services/wals,test/spine,test/providers/capture_provider_test.dart): 955 passed. This includes the existing network-loss replay, which still uploads the recording exactly once.bash app/test.sh: 3,910 passed, 5 skipped, 0 failed.bash app/test.shreports 3,942 passed, 5 skipped, 0 failed.flutter analyzeon the changed files: no new issues. The touched debug line also drops its unnecessary interpolation braces.Tests
app/test/services/capture/capture_phone_mic_backup_test.dart(new) uses the replay world: the realCaptureController, native mic service,LocalWalSyncImplandRecordingTransferCoordinator, with a scripted socket. Each scenario records 130 s with the socket connected and checks that every frame reached the server.app/test/unit/wal_recovery_test.dartandapp/test/unit/local_wal_sync_test.dart:misswith no retention clock, even with unlimited local storage on.misscopy is left alone even after the stopped recording's own copy has uploaded. After 20 rebinds of the same recording, its window still finds it. After logout, an old recording never matches.Failure class (fixes)
Failure-Class: none