Repository navigation
fix(app): show ring transfers as running in the recording page - #22790
undivisible merged 2 commits into
Conversation
RingStorageSync.syncWal read the device without marking the recording as syncing, so the detail page kept showing Transfer to Phone with no progress or Cancel while bytes were arriving. It also looked the recording up nowhere, leaving a page opened before a relist with an instance the UI never updates. The listed instance is now marked for the read and cleared in finally. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
The production change here is correct and nicely scoped — this fixes the reported bug with a regression test and matches the pattern already proven in the SD-card sync path.
Verified per file:
- app/lib/services/wals/ring_storage_sync.dart — syncWal now resolves the listed instance (
_wals.where((w) => w.storage == wal.storage && w.id == wal.id).firstOrNull ?? wal) exactly like SDCardWalSyncImpl.syncWal (sdcard_wal_sync.dart:940-960), sets isSyncing/syncStartedAt/syncMethod before the read, and clears every marker infinallyon success and failure — so the recording page (wal_item_detail_page.dart:140-146, 494) now sees progress, speed, ETA, and the Cancel button during a ring transfer, and can never get stuck on a stale marker after an error. The added speed/ETA/listener.onWalUpdated()lines in the throttled progress block sit under the same guards (storageTotalBytes > 0, throttled interval) that already gated deviceDownloadFraction, and the remaining-bytes ETA formula matches the SD-card implementation. Two consciously-checked details: thesyncMethod = SyncMethod.bleinfinallyis a no-op reset (it equals Wal's default, wal.dart:209, and matches sdcard_wal_sync.dart:1012), and thefinallycovers the incomplete-transfer throw path too. - app/test/unit/ring_storage_sync_no_advance_test.dart — the new test genuinely reproduces the bug's shape: it calls syncWal with a stale Wal copy while asserting the LISTED instance flips isSyncing during the read and that all markers clear after; assertions were also added to an existing error-path test. Good coverage of the actual failure mode (page holding a pre-relist instance).
- .github/failure-classes/FC-device-transfer-state-unpublished.json — follows the existing failure-class schema and points canonical_prevention at the new test.
- app/changelog/unreleased/20261020-ring-transfer-syncing-state.json — user-facing changelog fragment in the established format.
The syncAll path still publishes no per-recording state (acknowledged in the PR description; out of scope here).
USER IMPACT: During a ring recording transfer, the recording page now shows live progress, speed, and ETA with a working Cancel button, instead of an idle 'Transfer to Phone' button while the transfer quietly runs.
What I'd still want as a reviewer: nothing blocking. If you follow up on syncAll, the same listed-instance marker treatment would be the natural next step.
Git-on-my-level
left a comment
There was a problem hiding this comment.
Approving — this is correct and tightly scoped, and it mirrors the state publishing the SD-card syncWal already does.
Verified per file:
- app/lib/services/wals/ring_storage_sync.dart —
syncWalnow resolves the listed instance (storage+id match, so a recording page opened beforesetDevice()rebuilt_walsstill sees updates), setsisSyncing/syncStartedAt/syncMethodbefore the read, and the_syncRingprogress block publishessyncSpeedKBps/syncEtaSecondswithonWalUpdated()— exactly whatwal_item_detail_page.dartreads (lines 141–144, 495) for progress and the Cancel button.finallyclears every marker on both success and failure, matchingSDCardWalSyncImpl.syncWal. The?? walfallback (vs sdcard's throw when unlisted) is safe here since_syncRingdoesn't depend on listed-instance state. - app/test/unit/ring_storage_sync_no_advance_test.dart — the new regression test drives a stale
Walinstance through the real fake-device read path, asserts syncing-during-read and markers-cleared-after, and marker-clear asserts were added to the existing incomplete-transfer case. - .github/failure-classes/FC-device-transfer-state-unpublished.json — validated clean against
scripts/failure-class(declarationnew, artifact path exists). - app/changelog/unreleased/20261020-ring-transfer-syncing-state.json — accurate user-facing description.
One nit, no action needed: resetting syncMethod to ble in finally is a no-op since it's never changed off ble (sdcard does the same).
USER IMPACT: during a ring "Transfer to Phone", the recording page now shows live progress, speed, ETA, and a working Cancel button instead of looking idle.
Optional follow-up (non-blocking): a test that cancels mid-transfer from the detail-page path and asserts the markers clear.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
What changed and why
Fixes #22789.
RingStorageSync.syncWalread the ring without settingwal.isSyncing,syncStartedAt, orsyncMethod. The recording detail page renders Transfer to Phone untilisSyncingis true, and only then shows progress, speed, ETA, and a Cancel button. During a ring transfer the page therefore looked idle, and the transfer could not be cancelled from it.syncAllhad no per-recording UI state either, but this change covers the explicit Transfer to Phone path.syncWalnow marks the recording the sync UI reads (matched by storage and id, so a page opened before a relist still sees the update), sets the start time, publishes speed and ETA with progress, and clears every marker infinallyon success or failure.Product invariants affected
INV-CAP-1
The path glob matches
app/lib/services/wals/**. This change does not drop pendant audio. It only publishes transfer state so the user can see and cancel a ring transfer.How it was verified
origin/main(31a07230bb):RingStorageSyncImpl.syncWalsets only the private_isSyncing, whileSDCardWalSyncImpl.syncWalalso setsisSyncing,syncStartedAt,syncMethod,syncSpeedKBps, andsyncEtaSecondson the matchedWal.app/lib/pages/conversations/wal_item_detail/wal_item_detail_page.dartreadscurrentWal.isSyncingfor the Cancel button andsyncSpeedKBps/syncEtaSecondsfor progress.dart format --language-version=3.0 --line-length 120on the changed Dart files. The regression tests run in Omi CI (flutter test) withci:full. They have not been run locally.Tests
app/test/unit/ring_storage_sync_no_advance_test.dart:a transfer marks the listed recording as syncing for the whole read: starts a transfer from a staleWalinstance with the same id and storage, asserts the listed instance is syncing with a start time while the read is in flight, and asserts it is synced with every transfer marker cleared afterwards. Onmainthe listed instance never becomes syncing, so the first assertion fails.UI evidence
UI-Evidence: none -- state publication fix; the regression test covers the fields the page renders. The running app was not exercised locally.
Failure class (fixes)
Failure-Class: new
Failure-class transition narrative
New class
FC-device-transfer-state-unpublished.syncWalmarks the listed recording before reading and clears it infinally; the regression test asserts both edges.RingStorageSyncImpl.syncWalonorigin/mainbefore this change set noWalfield.evidence_prsis empty because this PR is the first instance.🤖 Generated with Claude Code