Repository navigation
fix(app): link later live conversations to their own backups (#20365) - #26035
Merged
Merged
Conversation
Rotate conversation windows on continuing sockets and retain per-close evidence. Reserve exact WAL identities before queued persistence; keep uncertain Process Now audio recoverable and fence account changes. Based on prior work in #20380 and #24846. Co-authored-by: Ashwin <[email protected]> Co-authored-by: cocvn157 <[email protected]>
Keep all unresolved Process Now decisions. Defer ambiguous events until exact IDs arrive, including a late older close during a newer disk drain; preserve unlinked audio on uncertainty.
Caption persistence, coalescing and provider tests now read the live window identity rather than hard-coding the former seconds-only key. Storage-only arbitrary key tests remain unchanged.
A failed middle snapshot must await prior admitted stamps before its tail completes. A negative regression proves a later server close cannot bypass the unresolved predecessor.
aryanorastar
marked this pull request as ready for review
November 22, 2026 10:26
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
1 task done
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.
Fixes #20365.
After the first conversation closes on a continuing pendant socket, capture currently clears its WAL window and never rearms it. Later saved conversations leave their backups unlinked and eligible for duplicate upload. A single pending-close slot also loses earlier evidence when results arrive out of order.
This change rotates a distinct conversation window without reconnecting, seals an exclusive WAL cut before any queued I/O, and retains per-close transcript/interruption/socket-mode evidence. Saved transcript coverage and existing committed-receipt rules still control retention. Partial, interrupted, held and uncertain audio remains recoverable, and upload preferences remain authoritative. Process Now reserves its own cut and resolves overlapping server events against every relevant outstanding response ID; ambiguous audio is never guessed into another conversation. Account retirement fences the writes and cancels pending timers. A failed disk snapshot still waits for its predecessor, so errors cannot detach the ordered tail.
The close lifecycle is isolated in a small capture part, and exact WAL cut ownership lives beside the ledger. Existing lifecycle/checkpoint finalization remains separate. Architecture, custody documentation and the implementation checklist are updated.
Credit: this builds on Ashwin's #20380 and cocvn157's #24846 rollover/snapshot work, adapted to current custody and typed Process Now contracts.
Validation:
INV-CAP-1: Every admitted frame stays in the owner-scoped ledger; exact sealed cuts establish lineage only. Unconfirmed or partial audio stays readable/recoverable and existing policy alone releases confirmed copies into synced retention.
Failure-Class: none
The existing buffer-clear-after-async-flush and cross-device duplicate-capture classes have different failure mechanisms/prevention: this defect is a missing conversation-window rollover plus overwritten close evidence, resolved with per-close snapshots rather than content dedupe or cleanup policy changes.
UI-Evidence: none -- capture and ledger behavior only; no Flutter view or user-facing layout changed.
Line-Count-Exception: app/lib/services/wals/local_wal_sync.dart | 3155 -> 3196 | Keep admission sealing beside the existing frame buffer and extension paths; token handling is extracted into conversation_wal_snapshot.dart and the capture controller shrinks.