Skip to content

Commit 9b82867

Browse files
fix: Syncing After Uploads when using Triggers (#781)
1 parent b4b393b commit 9b82867

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/four-falcons-arrive.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+
Fixed issue where using triggers could block syncing after performing uploads.

packages/common/src/client/sync/bucket/SqliteBucketStorage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export class SqliteBucketStorage extends BaseObserver<BucketStorageListener> imp
255255
// Nothing to update
256256
return false;
257257
}
258-
const rs = await this.db.getAll<{ seq: number }>("SELECT seq FROM sqlite_sequence WHERE name = 'ps_crud'");
258+
const rs = await this.db.getAll<{ seq: number }>("SELECT seq FROM main.sqlite_sequence WHERE name = 'ps_crud'");
259259
if (!rs.length) {
260260
// Nothing to update
261261
return false;
@@ -273,7 +273,7 @@ export class SqliteBucketStorage extends BaseObserver<BucketStorageListener> imp
273273
return false;
274274
}
275275

276-
const rs = await tx.execute("SELECT seq FROM sqlite_sequence WHERE name = 'ps_crud'");
276+
const rs = await tx.execute("SELECT seq FROM main.sqlite_sequence WHERE name = 'ps_crud'");
277277
if (!rs.rows?.length) {
278278
// assert isNotEmpty
279279
throw new Error('SQLite Sequence should not be empty');

0 commit comments

Comments
 (0)