Repository navigation
fix(app): keep the SD card when a legacy sync chunk is not saved - #14899
Merged
kodjima33 merged 1 commit intoSep 19, 2026
Merged
Conversation
1 task done
kodjima33
approved these changes
Sep 19, 2026
kodjima33
left a comment
Collaborator
There was a problem hiding this comment.
Scoped, well-tested bug/doc fix; passes confidence gate.
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 #14907
On firmware without timestamp markers,
_readStorageBytesToFileLegacycatches any error from the chunk callback, setshasErrorand breaks. The function then returns normally, so_syncWalseeschunksDownloaded > 0, sends the clear command (_writeToStorage(..., 1, 0)) andsyncWalmarks the recording synced.The callback throws when the user cancels (
Sync cancelled by user) and whenaddExternalWalfails to save a chunk. In both cases the chunks after the failed one are only in memory, and the card has just been wiped, so that part of the recording is gone. The marker path already propagates the same error throughcompleter.completeError(e); this makes the legacy pathrethrowsosyncWaltakes its existing error branch and the card is left alone. A retry downloads the file again, so chunks saved before the failure are saved a second time. That seemed better than losing the rest of the file.testConnectionlets the test drive_writeToStorageand the storage listener without the device service.test/unit/sdcard_legacy_sync_test.dartstreams a file of just over two 180 s chunks. On main the cancel test and the failed-save test both fail (Expected: throws ... Actual: <Instance of 'Future<SyncLocalFilesResponse?>'>), because the sync completes and clears the card. With the fix all three pass; the third checks that a clean download still clears the card and marks the recording synced.Failure-Class: none