Description
Product impact
- Primary loop layer: Capture
- Involves data loss, failed capture, or broken sync/trust
Describe the bug
On firmware without timestamp markers, SD card sync uses _readStorageBytesToFileLegacy in app/lib/services/wals/sdcard_wal_sync.dart. If saving a chunk fails, or the user cancels mid-download, the chunk loop catches the error, sets hasError and breaks, then returns normally. _syncWal sees that some chunks were downloaded, sends the clear command to the device, and syncWal marks the recording synced.
To Reproduce
- Use a device on firmware without timestamp markers, with a recording on the SD card longer than one 180 s chunk.
- Start the SD card sync.
- Cancel it after the first chunk has saved (or have the phone fail to save a chunk, e.g. out of storage).
Current behavior
The SD card is cleared and the recording shows as synced. Everything after the first chunk only existed in memory, so it is gone.
Expected behavior
A cancelled or failed download leaves the SD card alone and the recording unsynced, so the sync can be retried. The marker path already does this by completing with the error.
Additional context
Reproduced on origin/main with a unit test that streams just over two chunks from a fake device and cancels after the first; the clear command is sent.
Proposing this as a paid bounty ($50, since it loses recorded audio) per the contribution docs, @kodjima33. The fix with tests is in #14899.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn review
Activity