Skip to content

Commit b4f617b

Browse files
committed
Fix forwarding control messages
1 parent 4ceb32e commit b4f617b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ The next upload iteration will be delayed.`);
884884
return;
885885
}
886886

887-
await control(line[0], line[1]);
887+
await control(line.command, line.payload);
888888
}
889889
} finally {
890890
await controlInvocations.close();
@@ -980,11 +980,16 @@ The next upload iteration will be delayed.`);
980980
}
981981

982982
try {
983+
await control(
984+
PowerSyncControlCommand.START,
985+
JSON.stringify({
986+
parameters: resolvedOptions.params
987+
})
988+
);
989+
983990
this.notifyCompletedUploads = () => {
984991
controlInvocations?.enqueueData({ command: PowerSyncControlCommand.NOTIFY_CRUD_UPLOAD_COMPLETED });
985992
};
986-
987-
await control(PowerSyncControlCommand.NOTIFY_CRUD_UPLOAD_COMPLETED, JSON.stringify(resolvedOptions.params));
988993
await receivingLines;
989994
} finally {
990995
this.notifyCompletedUploads = undefined;

0 commit comments

Comments
 (0)