Repository navigation
Conversation
On firmware 3.0.17-3.0.19 the device recordings come from StorageSync and use WalStorage.sdcard, but WalSyncs.syncWal sent every sdcard recording except the ring's to the legacy SD card sync. That sync returns null for a recording it does not list, so Transfer to Phone read nothing from the device and the page still said the transfer was complete. Route recordings that StorageSync listed to StorageSyncImpl.syncWal. That method was unreachable and also dropped the transfer's completion result. It now marks the recording synced and deletes the device file only after a complete, durable transfer, using the guarded delete from syncAll (moved into a shared helper). It throws when the transfer is incomplete, shows the recording as transferring while it runs, and refuses to start while a device drain is already reading. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
After a per-recording transfer deletes the file, the firmware moves the next file into its index. Keeping the synced recording listed under that index let a later "Clear synced" (deleteAllSyncedWals) send CMD_DELETE_FILE for it and delete a recording that was never transferred. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 19, 2026
kodjima33
approved these changes
Oct 19, 2026
kodjima33
left a comment
Collaborator
There was a problem hiding this comment.
Mobile bug fix for device-recording transfer, root cause stated, linked issue, CI green. Confidence 4-5/5.
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.
What changed and why
Fixes #22306
On Omi firmware 3.0.17 to 3.0.19 (the multi-file storage protocol), pressing "Transfer to Phone" on a device recording reads nothing from the device, then shows "Transfer complete! You can now play this recording." and closes the page. The recording is still only on the pendant.
StorageSyncImpllists these recordings asWalStorage.sdcardwith a 0-basedfileNum.WalSyncs.syncWalsent everysdcardrecording except the ring's (fileNum == -1) toSDCardWalSyncImpl.syncWal. That method looks the recording up by identity in its own list and returns null when it isn't there, and a StorageSync recording never is.SyncProvider.transferWalToPhonetreats the null as success. #6656 reported this path on 3.0.17 as aBad state: No elementcrash, and #6803 turned the crash into today's silentreturn null. a1f18aa (#7218) fixed the same misroute for ring recordings only.WalSyncs.syncWalnow sends a recording thatStorageSyncImpllisted toStorageSyncImpl.syncWal, through a newownscheck. It matches by identity, the same rule as the SD card sync's own lookup. Ring and legacy SD card routing are unchanged.StorageSyncImpl.syncWalwas unreachable until now. It also dropped_syncSingleFile's completion result and swallowed errors. With the routing fix alone, a transfer would never be marked synced or removed from the device, so the next drain would download and upload the same audio again. It now:syncAll, moved into_deleteTransferredFile(which now also returns whether the device deleted the file), and re-indexes the other listed files;deleteAllSyncedWals) delete a recording that was never transferred.syncAllstill keeps synced recordings listed; that is a separate fix;syncAll;wal.isSyncingwhile the transfer runs, so the page shows progress and Cancel, and passes progress through;syncAllnever setsisSyncing.sync_provider.dartandwal_item_detail_page.dartare unchanged:transferWalToPhonealready rethrows, and the page already showstransferFailedMessagefor an error.Product invariants affected
app/lib/services/wals/**. The device file is still deleted only after the audio is durably registered on the phone, through the same guarded delete assyncAll. An incomplete transfer keeps the file on the device.How it was verified
origin/main(def12bf):storage_sync.dart:214-229builds the device recordings withfileNum: file.index, which is 0-based (omi_connection.dart:559).wal_syncs.dart:373-379sends them toSDCardWalSyncImpl.syncWal.sdcard_wal_sync.dart:942-946returns null for a recording it does not list.Walhas no==override, so this is an identity check.sync_provider.dart:1177-1197ignores the null, andwal_item_detail_page.dart:454-463showstransferCompleteMessageand pops.StorageSyncImpl.syncWal, and thatisStorageSyncing(wal_syncs.dart:404) covers the new per-recording transfer, so drains back off while it runs.dart format --line-length 120on the changed Dart files made no changes. Checked the new failure-class file withvalidate_definitionfromscripts/failure-class.ci:fullruns the new tests and the full app suite. I wrote the new tests to fail without the fix: onmainthe call reachesSDCardWalSyncImpl.syncWal, which returns null with no device read, no deletion and no error.Tests
app/test/unit/legacy_storage_limitless_seam_test.dartdrivesWalSyncs.syncWalwith the file's existing fake device and fake local sync:WalSyncs.syncWal transfers a listed multi-file recording and then deletes it on the device: one CMD_READ_FILE for file 1 and one durable phone chunk. The status becomes synced,isSyncingis cleared, file 1 is deleted, and the next file is re-indexed from 2 to 1. A followingdeleteAllSyncedWalssends no second delete, and the next recording stays listed.WalSyncs.syncWal fails an incomplete multi-file transfer and keeps the file on the device: the call throws, nothing is deleted, and the status stays miss.WalSyncs.syncWal refuses a multi-file recording while a device drain is running: the per-recording call throws whilesyncAllis saving. The drain keeps the only read and finishes normally.The existing
syncAlltests in the same file cover the moved delete, includingdelete only happens after the chunk is durably registeredanda device switch during persistence never issues DELETE on either connection.UI evidence
UI-Evidence: none -- no layout change: the page reuses its existing transfer progress, success and failure states, and no simulator or device is available here. The tests above cover the service path the page reads.
Failure class (fixes)
Failure-Class: new
Failure-class transition narrative
New class
FC-per-wal-sync-routed-to-non-owner.WalSyncs.syncWalpicked the handler from the sharedWalStorage.sdcardtag.Waland have the owner raise an incomplete or refused transfer.app/test/unit/legacy_storage_limitless_seam_test.dartdrivesWalSyncs.syncWalend to end for multi-file recordings.evidence_prsis empty because this PR is the first one filed under the class.🤖 Generated with Claude Code