Skip to content

Commit abdec98

Browse files
Update changesets
1 parent 8cfc0e6 commit abdec98

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.changeset/rare-windows-argue.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
'@powersync/web': patch
33
---
44

5-
No longer awaiting when aborting connection on tab closure. Fixes some edge cases where multiple tabs with OPFS/Safari can cause deadlocks.
5+
- Fixed some edge cases where multiple tabs with OPFS can cause sync deadlocks.
6+
- Fixed issue where calling `powerSync.close()` would cause a disconnect if using multiple tabs (the default should not be to disconnect if using multiple tabs)
7+
- Improved shared sync implementation database delegation and opening strategy.

.changeset/witty-steaks-worry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'@powersync/common': minor
33
---
44

5-
Serializing upload and download errors for SyncStatus events. Small changes to how delay values are passed to the sync implementation internally.
5+
- Improved serializing of upload and download errors for SyncStatus events. Some JS `Error`s are not cloneable, the JSON representation of a SyncStatus should now always be cloneable.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ The next upload iteration will be delayed.`);
429429
uploadError: ex
430430
}
431431
});
432-
await this.delayRetry(controller.signal, this.options.crudUploadThrottleMs);
432+
await this.delayRetry(controller.signal);
433433
if (!this.isConnected) {
434434
// Exit the upload loop if the sync stream is no longer connected
435435
break;
@@ -1216,14 +1216,14 @@ The next upload iteration will be delayed.`);
12161216
this.iterateListeners((cb) => cb.statusUpdated?.(options));
12171217
}
12181218

1219-
private async delayRetry(signal?: AbortSignal, delayMs?: number): Promise<void> {
1219+
private async delayRetry(signal?: AbortSignal): Promise<void> {
12201220
return new Promise((resolve) => {
12211221
if (signal?.aborted) {
12221222
// If the signal is already aborted, resolve immediately
12231223
resolve();
12241224
return;
12251225
}
1226-
const delay = delayMs ?? this.options.retryDelayMs;
1226+
const { retryDelayMs } = this.options;
12271227

12281228
let timeoutId: ReturnType<typeof setTimeout> | undefined;
12291229

@@ -1237,7 +1237,7 @@ The next upload iteration will be delayed.`);
12371237
};
12381238

12391239
signal?.addEventListener('abort', endDelay, { once: true });
1240-
timeoutId = setTimeout(endDelay, delay);
1240+
timeoutId = setTimeout(endDelay, retryDelayMs);
12411241
});
12421242
}
12431243

0 commit comments

Comments
 (0)