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