Skip to content

Commit bd133d0

Browse files
wip: abort rust connections if early abort detected
1 parent e3d46d2 commit bd133d0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/honest-penguins-worry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/common': patch
3+
---
4+
5+
Fix issue where Rust sync implementation might not disconnect in some circumstances.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,9 @@ The next upload iteration will be delayed.`);
899899
let receivingLines: Promise<void> | null = null;
900900
let hadSyncLine = false;
901901

902+
if (signal.aborted) {
903+
return;
904+
}
902905
const abortController = new AbortController();
903906
signal.addEventListener('abort', () => abortController.abort());
904907

0 commit comments

Comments
 (0)