File tree 3 files changed +50
-1
lines changed
core/src/commonIntegrationTest/kotlin/com/powersync
3 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 1.0.0-BETA28
4
+
5
+ * Update PowerSync SQLite core extension to 0.3.12.
6
+
3
7
## 1.0.0-BETA27
4
8
5
9
* Improved watch query internals. Added the ability to throttle watched queries.
Original file line number Diff line number Diff line change @@ -267,6 +267,51 @@ class SyncIntegrationTest {
267
267
turbine.cancel()
268
268
}
269
269
270
+ database.close()
271
+ syncLines.close()
272
+ }
273
+
274
+ @Test
275
+ fun testMultipleSyncsDoNotCreateMultipleStatusEntries () =
276
+ runTest {
277
+ val syncStream = syncStream()
278
+ database.connect(syncStream, 1000L )
279
+
280
+ turbineScope(timeout = 10.0 .seconds) {
281
+ val turbine = database.currentStatus.asFlow().testIn(this )
282
+ turbine.waitFor { it.connected && ! it.downloading }
283
+
284
+ repeat(5 ) {
285
+ syncLines.send(
286
+ SyncLine .FullCheckpoint (
287
+ Checkpoint (
288
+ lastOpId = " 1" ,
289
+ checksums =
290
+ listOf (
291
+ BucketChecksum (
292
+ bucket = " bkt" ,
293
+ checksum = 0 ,
294
+ ),
295
+ ),
296
+ ),
297
+ ),
298
+ )
299
+ turbine.waitFor { it.downloading }
300
+
301
+ syncLines.send(SyncLine .CheckpointComplete (lastOpId = " 1" ))
302
+ turbine.waitFor { ! it.downloading }
303
+
304
+ val rows =
305
+ database.getAll(" SELECT * FROM ps_sync_state;" ) {
306
+ it.getString(1 )!!
307
+ }
308
+
309
+ assertEquals(1 , rows.size)
310
+ }
311
+
312
+ turbine.cancel()
313
+ }
314
+
270
315
database.close()
271
316
syncLines.close()
272
317
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ kotlinx-datetime = "0.5.0"
15
15
kotlinx-io = " 0.5.4"
16
16
ktor = " 3.0.1"
17
17
uuid = " 0.8.2"
18
- powersync-core = " 0.3.11 "
18
+ powersync-core = " 0.3.12 "
19
19
sqlite-android = " 3.45.0"
20
20
sqlite-jdbc = " 3.45.2.0"
21
21
turbine = " 1.2.0"
You can’t perform that action at this time.
0 commit comments