Repository navigation
fix(sync): allow recovery export and bulk clear for backlog outside recovery window (#21217) - #21320
Dragonire9 wants to merge 6 commits into
Conversation
…ncable clear action in storage sheet
…ection and export
|
Thanks for this — solid diagnosis and a clean, well-scoped fix for #21217. I went through the diff file by file: app/lib/pages/conversations/sync_page.dart — Wrapping the existing Delete button in a Row with the app/lib/pages/conversations/widgets/offline_sync_storage_sheet.dart — The new unsyncable app/lib/providers/sync_provider.dart — app/test/widgets/offline_sync_storage_contrast_test.dart and sync_row_recovery_window_test.dart — Both new tests are hermetic and assert real behavior (chevron presence on terminal rows; Failed category rendering, count, and clear callback firing). Nice to see the affordance locked down by a test. Two minor, non-blocking notes:
Since this adds a user-facing bulk deletion action, I'll leave the merge call to a human maintainer, but the implementation looks correct and well-tested. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
@Git-on-my-level Thank you for the detailed review and validating the fix across the sync flow!
Ready for maintainer merge sign-off! |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for this — it's a well-scoped fix for #21217, and I verified the core wiring is sound. Two CI blockers need fixing before this can move forward.
What looks good (verified against the diff and current main):
app/lib/pages/conversations/sync_page.dart— restoring the chevron on terminal rows (corrupted / outsideRecoveryWindow / unsupportedAudio / uploadRejected) next to the Delete button lets users reach the detail page to inspect, play back, and export before deleting. Sensible change; the new comment documents the intent well.app/lib/providers/sync_provider.dart—deleteAllCorruptedWals()follows the same session-generation pattern as its siblings and delegates to the existingWalSyncs/LocalWalSync.deleteAllCorruptedWals()(wal_syncs.dart:222, local_wal_sync.dart:1762), which filters exactly the same four terminal statuses as thecorruptedWalsgetter. So the count shown in the sheet matches what gets deleted — no new deletion logic, no drift between UI bucket and service filter. Good.app/lib/pages/conversations/widgets/offline_sync_storage_sheet.dart— the newunsyncableCount/onClearUnsyncableparams are optional with safe defaults, so existing call sites are unaffected, and the Failed row only renders when the count is non-zero.- Both widget tests are hermetic and cover the new behaviors (chevron presence; row render + clear callback), and the changelog fragment matches the actual behavior.
Blocking (both are CI failures on this head):
- Formatting —
dart formatchangesapp/test/widgets/sync_row_recovery_window_test.dart("Formatted 5 files (1 changed)"). Please rundart formaton the app package and push. - Hygiene / ui-evidence — modified files under
app/lib/are UI source, so the ui-evidence gate requires at least one tracked screenshot referenced from the PR body (.agent-artifacts/ui-evidence/...pinned to a commit), or an exactUI-Evidence: none -- <reason>escape line if it genuinely doesn't apply. Since this is a visible UI change, screenshots of the Failed storage row and the Delete + chevron row would be ideal.
Minor, non-blocking:
- The Failed row subtitle reuses
l10n.syncStatusTooOld("Too old to sync — Omi can't accept it"), but the bucket also contains corrupted / unsupported-audio / upload-rejected recordings. A more neutral subtitle would avoid confusion when the bucket is mixed. - Restoring the chevron reverses an earlier deliberate choice (the old comment said the detail page had "nothing actionable on it"). Your export-first rationale is convincing, but flagging so a maintainer can confirm the detail page does offer playback/export for these terminal states.
No security concerns: both destructive flows reuse the existing confirm dialog and service-layer deletion path.
Once formatting and the ui-evidence gate are green, this should be ready for maintainer merge — human review is still needed for the merge call itself and the UX judgment on the restored chevron.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
Thanks for this contribution! Our review requested some changes (see above) and we haven't heard back in a while. If you're still working on it, just push a commit or leave a comment within the next 7 days. To keep the queue healthy we'll close this PR in 14 days if it stays inactive — and it can always be reopened once updates land. Happy to re-review! |
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](https://apps.apple.com/us/app/omi-smart-meeting-notes/id6502156163)). #21320 remains separate: navigation/bulk cleanup does not solve request-level attribution or an authentication refusal. Validation: - Eight failures reproduced against unchanged main before the fix. All 84 focused state/provider/UI regressions pass, including persisted refusals, mixed terminal files, local-only custody, coalesced retries, authentication persistence, account changes during isolation and manifest completeness. The final broad app rerun passed: 7,016 tests, nine skips, zero failures, plus 138 spine tests. The final normal pre-push gate and all 25 selected preflight checks pass. Its history-dependent failure-class ratchet explicitly skips this shallow clone; no history-dependent coverage is claimed locally. - All six hermetic mobile journeys pass (23 assertions); `make mobile-verify ARGS="fast --all"`. - Changed Dart files analyze cleanly; the full analyzer ratchet passes with the original baseline unchanged. - Native iPhone 16 Pro / iOS 26.5 simulator build and agent-flutter interaction passed with real SyncProvider, LocalWalSyncImpl and AutoSyncPage and a synthetic uploader: requests [3, 1, 1, 1], two files synced, one uploadRejected, all three original files retained. The existing Share Recording control produced a valid 60-second, mono 16 kHz WAV. No customer audio, production account or live STT was used. Initial local-Firebase SDK settings requests logged test-configuration errors; they were not successful Omi uploads. Captures and source hashes are in .agent-artifacts/ui-evidence/fix-23049-upload-refusal/verification.json. - Regression commands: `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](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.4) permits retry with different credentials; [§15.5.14](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.14) refuses the request's size, not each member's audio. `backend/utils/sync/files.py:validate_input_files` rejects a whole request when one filename/timestamp is invalid. An isolated single-file 400/413 still stops automatic uploads. Existing `Wal.markUploadRejected` already 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: - Needs merge, CI/review and an iOS/Android app release. No backend deployment, firmware update, bulk migration or account-data mutation is introduced by this PR. - The supplied log excerpt confirms stale phone-local backlog but includes no upload response, terminal refusal reason, app version or decode result. These are demonstrated app defects, not a confirmed diagnosis or recovery of that customer's nine files. Retained-record counts are not recovered-record counts. - Physical phone verification remains: update to the released build, retry one affected recording, verify the resulting conversation stays after refresh/reopen, and verify a saved export plays. Do not delete Pending/All, log out, reset or reinstall to troubleshoot while local audio may remain. - Invalid historical recording timestamps and genuinely undecodable/missing audio are not repaired by retry; no original time is invented and no server age/timestamp guard is bypassed. Keep #23049 open until the customer's outcome is verified. - Architecture and implementation checklist: app/docs/offline-sync-stall-recovery.md. ## 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    <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/23056?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/23056?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23056&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-off-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-off-auto-fix-light.svg"><img alt="Turn off auto-fix" src="https://www.cubic.dev/buttons/turn-off-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. --> ## 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.
|
Withdrawing this pull request and closing it. For the record: I committed and engineered these fixes under the expectation of the repository's paid bug bounty program, not as unpaid open-source charity. All unmerged contributions are permanently withdrawn. |
|
Hey @Dragonire9 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Resolves #21217
Problem
When an offline backlog (e.g. from a Limitless pendant) accumulates during a prolonged sync issue exceeding the 30-day lookback window (outsideRecoveryWindow), recordings are marked as permanently refused. Previously:
Solution