Repository navigation
fix(sync): recover retained recordings after upload refusals - #23056
Conversation
Failure-Class: FC-batch-fault-domain-head-of-line-poison Refs #23049. Preserve local audio and original capture times while separating request failures from per-file verdicts.
Codex Review SummaryThis 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. |
|
Verdict: the production change is correct and nicely scoped — batch-refusal isolation, the 401/403 authentication pause, and manual re-arm of historical refusals all verify against the diff; leaving for human maintainer review before merge. What I verified on this head:
Blast radius: only users with refused or auth-paused uploads see changed behavior — no deletion, no retiming, no server contract change; retry amplification is bounded (one isolation pass per member, exhausted budget on auth failure). USER IMPACT: recordings previously stuck showing Failed with only a Delete option after an upload refusal now get a Try Again that actually re-uploads them, and one bad file in a batch no longer blocks its siblings. Still wanted: I could not run the Dart suite in this environment (no Flutter SDK available to me); CI is green on this head, but a maintainer sanity-run of the regression commands listed in app/docs/offline-sync-stall-recovery.md before merge would close that gap. 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.
Good-faith fix from a trusted contributor with tests and UI evidence, but diff is large (633 lines/21 files) and GitHub currently reports mergeStateStatus=UNKNOWN; approving, holding merge for a clean mergeability recheck.
|
Verdict: the production change is correct and nicely scoped — I verified the refusal-isolation and retry paths against the diff and found nothing blocking. What I verified:
UX: users with recordings stuck as Failed/Delete-only after a server refusal now get a working Try Again and can recover them without losing audio. Blast radius: offline-sync drain and its UI only; worst case if the isolation heuristic is wrong is one bounded re-attempt per file, never data loss. Cost/performance: no new external calls beyond the bounded per-member retries. USER IMPACT: recordings previously stuck as permanently failed after an upload refusal now offer Try Again and can recover, and one bad file no longer blocks the rest of a batch. Nothing blocking from my side; the approval already on this head stands from my perspective too. Optional nicety only: a brief in-app note when an isolated single-file retry gets refused again (it lands terminal uploadRejected), so users understand why Delete is then the only action. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
Move the 400/413 refusal classification into mains extracted wal_policy part; retain holdForUser automatic-upload fencing. Focused state/provider/UI checks: 84 tests passed; analyzer ratchet passed. Final full-suite/CI and physical acceptance remain gates; keep draft.
Offline Sync can mark every member of a refused multi-file request as permanently failed, and HTTP 403 was classified as an audio refusal. The resulting saved files show Failed with only Delete, despite the single-file uploader supporting an explicit retry. Refused 400/413 batches now isolate members through the existing upload gate before assigning a per-file verdict; authentication failures retain the file, persist a pause and stop that drain. The card, recording/file rows and error-card Retry re-arm historical request refusals through the existing owner. No audio is deleted or retimed; local-only custody and confirmed missing/audio/window verdicts stay excluded.
Refs #23049. The original spent-budget card no-op (#21828) is already merged and released in iOS 1.0.566 (App Store release notes). #21320 remains separate: navigation/bulk cleanup does not solve request-level attribution or an authentication refusal.
Validation:
make mobile-verify ARGS="fast --all".flutter test test/unit/wal_upload_resilience_test.dart test/unit/wal_sync_display_state_test.dart test/providers/sync_provider_needs_attention_retry_test.dart test/providers/sync_provider_sync_wal_wake_test.dart test/pages/conversations/offline_sync_recording_blocks_test.dart test/widgets/sync_row_recovery_window_test.dart;bash app/test.sh;bash app/scripts/analyze_ratchet.sh;make preflight.Expected-value changes have external/owning contracts: RFC 9110 §15.5.4 permits retry with different credentials; §15.5.14 refuses the request's size, not each member's audio.
backend/utils/sync/files.py:validate_input_filesrejects a whole request when one filename/timestamp is invalid. An isolated single-file 400/413 still stops automatic uploads. ExistingWal.markUploadRejectedalready preserves bytes for deliberate resubmission. The regression executes that owner, not source-string assertions. It extends the existing FC-batch-fault-domain-head-of-line-poison guard surface rather than adding a separate retry authority.Release and customer verification:
Product invariants affected
INV-CAP-1: refuse neither custody nor capture. No uplink pause, frame deletion or firmware assumption is added; failed requests retain phone files, original times and ownership. Existing live-capture fences and manifest-completeness checks stay in force.
INV-UI-1 / INV-UI-3: reuse existing neutral Omi retry controls and localized copy; keep playback/export navigation.
INV-PERF-1: bounded upload isolation in the existing async owner; no UI-isolate audio work is added.
Failure-Class: FC-batch-fault-domain-head-of-line-poison
Line-Count-Exception: app/lib/services/wals/local_wal_sync.dart | 2764 -> 2804 | Keep refusal isolation and verdict persistence at the existing upload owner; use the existing bounded batch selector, gate and account-generation fence.
UI evidence
2026-10-23 maintainer review and merge readiness
Resolved current-main integration by keeping the extracted wal_policy.dart owner and holdForUser automatic-upload exclusion, while retaining 400/413 refusal isolation and treating 401/403 as authentication pauses; reviewed head fc58d4d. The 84 focused state/provider/UI tests, analyzer ratchet and 25 selected preflight checks pass. In a dedicated iPhone 16 Pro / iOS 26.5 simulator, the production SyncProvider, LocalWalSyncImpl and AutoSyncPage exercised Try Again against a synthetic uploader: request batch sizes were [3, 1, 1, 1], two WALs became synced, the persistently rejected WAL stayed uploadRejected, original timestamps stayed unchanged, and all three 1,944,000-byte source files remained. The Synced tab displayed the two successes. This is fixture-backed processing, not actual Omi STT or recovered customer conversations; placeholder Firebase warnings are not successful account authentication.
Aryan approved risk-proportionate verification on 2026-10-23 and authorized proceeding with this merge candidate. This PR changes client-side refusal attribution and deliberate retry, not the native recorder, background lease, codec or backend processing contract. The production-owner simulator interaction, focused failure/account/custody regressions and current-head CI satisfy its pre-merge scope; live STT and the customer's actual recordings are not required to validate that bounded change. Fresh GitHub checks report no failed or pending checks, the required Mobile Release Eligibility check passes, existing approval is present, and the branch is cleanly mergeable. No source was changed by this readiness reassessment.
Actual server conversation recovery, playback/export on the customer's released phone build and customer acceptance remain post-release incident follow-up, not claims of completed verification. The separate physical QA host has not produced a passing phone result. Keep #23049 open. This merge is not a backend deployment or confirmation of an app/store release, and no production/customer data was used.