Skip to content

Commit d61e679

Browse files
committed
Increment download count only after saving
1 parent 10ce28b commit d61e679

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/commonMain/kotlin/com/powersync/sync/SyncStream.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ internal class SyncStream(
436436
state: SyncStreamState,
437437
): SyncStreamState {
438438
val batch = SyncDataBatch(listOf(data))
439-
status.update { copy(downloading = true, downloadProgress = downloadProgress?.incrementDownloaded(batch)) }
440439
bucketStorage.saveSyncData(batch)
440+
status.update { copy(downloading = true, downloadProgress = downloadProgress?.incrementDownloaded(batch)) }
441441
return state
442442
}
443443

0 commit comments

Comments
 (0)