Skip to content

Commit 0c82473

Browse files
committed
Remove duplicate upload logic
1 parent 53236a8 commit 0c82473

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/common/src/client/ConnectionManager.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ export class ConnectionManager extends BaseObserver<ConnectionManagerListener> {
194194

195195
this.logger.debug('Attempting to connect to PowerSync instance');
196196
await this.syncStreamImplementation?.connect(appliedOptions!);
197-
this.syncStreamImplementation?.triggerCrudUpload();
198197
}
199198

200199
/**

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,12 +885,12 @@ The next upload iteration will be delayed.`);
885885
return;
886886
}
887887

888+
await control(line.command, line.payload);
889+
888890
if (!hadSyncLine) {
889891
syncImplementation.triggerCrudUpload();
890892
hadSyncLine = true;
891893
}
892-
893-
await control(line.command, line.payload);
894894
}
895895
} finally {
896896
const activeInstructions = controlInvocations;
@@ -999,6 +999,7 @@ The next upload iteration will be delayed.`);
999999
);
10001000

10011001
this.notifyCompletedUploads = () => {
1002+
console.log('notify completed');
10021003
controlInvocations?.enqueueData({ command: PowerSyncControlCommand.NOTIFY_CRUD_UPLOAD_COMPLETED });
10031004
};
10041005
await receivingLines;

0 commit comments

Comments
 (0)