File tree Expand file tree Collapse file tree 3 files changed +50
-1
lines changed
core/src/commonIntegrationTest/kotlin/com/powersync Expand file tree Collapse file tree 3 files changed +50
-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 @@ -267,6 +267,51 @@ class SyncIntegrationTest {
267267 turbine.cancel()
268268 }
269269
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+
270315 database.close()
271316 syncLines.close()
272317 }
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