Skip to content

Commit 708b24b

Browse files
fix: diagnostics app dynamic schema
1 parent 949a7d8 commit 708b24b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.changeset/loud-melons-try.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/diagnostics-app': patch
3+
---
4+
5+
Fixed bug where Rust client implementation would not update the dynamic schema after sync.

tools/diagnostics-app/src/library/powersync/RustClientInterceptor.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import {
66
ColumnType,
77
DBAdapter,
88
isStreamingSyncCheckpoint,
9+
isStreamingSyncCheckpointComplete,
910
isStreamingSyncCheckpointDiff,
11+
isStreamingSyncCheckpointPartiallyComplete,
1012
isStreamingSyncData,
1113
PowerSyncControlCommand,
1214
SqliteBucketStorage,
@@ -102,6 +104,12 @@ export class RustClientInterceptor extends SqliteBucketStorage {
102104
});
103105

104106
await this.schemaManager.updateFromOperations(batch);
107+
} else if (isStreamingSyncCheckpointPartiallyComplete(line) || isStreamingSyncCheckpointComplete(line)) {
108+
// Refresh schema asynchronously, to allow us to better measure
109+
// performance of initial sync.
110+
setTimeout(() => {
111+
this.schemaManager.refreshSchema(this.rdb);
112+
}, 60);
105113
}
106114
}
107115

0 commit comments

Comments
 (0)