diff --git a/docs/superpowers/plans/2026-11-17-usb-image-backup.md b/docs/superpowers/plans/2026-11-17-usb-image-backup.md index 403e0af..05e0989 100644 --- a/docs/superpowers/plans/2026-11-17-usb-image-backup.md +++ b/docs/superpowers/plans/2026-11-17-usb-image-backup.md @@ -415,7 +415,7 @@ In the job coroutine, after device init and `devSize`: - Backup branch: - `imageSize = devSize` so error broadcasts report a sane total. - Best-effort space check: `val existingSize = try { mSourceUri.getFileSize(this@WorkerService) } catch (_: Exception) { null }`; `val available = availableBytesFor(this@WorkerService, mSourceUri)`; only when both are non-null and `available < devSize - existingSize`, throw `NotEnoughSpaceForBackupException(devSize - existingSize, available)`. When the size cannot be queried, skip the pre-check rather than risk failing a resumable job. - - Broadcast the first progress intent with `processedBytes = existingSize ?: 0L`, `totalBytes = devSize`, `speed = 0f`, `isBackup = true`. + - Broadcast the first progress intent with `processedBytes = 0L`, `totalBytes = devSize`, `speed = 0f`, `isBackup = true` (the prefix-hash phase advances it to the resume offset, so the bar never moves backwards). - `val sha256 = runBackup(blockDev, devSize, coroScope)`. - `getFinishedIntent(mSourceUri, mDestDevice, devSize, isBackup = true, sha256 = sha256).broadcastLocallySync(this)`. - `runBackup`: