Skip to content

Commit 6fe2f63

Browse files
committed
Only set uploading when there are things to upload
1 parent 5342933 commit 6fe2f63

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/common/src/client/sync/stream/AbstractStreamingSyncImplementation.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,17 +342,18 @@ export abstract class AbstractStreamingSyncImplementation
342342
let checkedCrudItem: CrudEntry | undefined;
343343

344344
while (true) {
345-
this.updateSyncStatus({
346-
dataFlow: {
347-
uploading: true
348-
}
349-
});
350345
try {
351346
/**
352347
* This is the first item in the FIFO CRUD queue.
353348
*/
354349
const nextCrudItem = await this.options.adapter.nextCrudItem();
355350
if (nextCrudItem) {
351+
this.updateSyncStatus({
352+
dataFlow: {
353+
uploading: true
354+
}
355+
});
356+
356357
if (nextCrudItem.clientId == checkedCrudItem?.clientId) {
357358
// This will force a higher log level than exceptions which are caught here.
358359
this.logger.warn(`Potentially previously uploaded CRUD entries are still present in the upload queue.

0 commit comments

Comments
 (0)