diff --git a/CHANGELOG.md b/CHANGELOG.md index de64b8a7..a65124a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.0.0-BETA28 + +* Update PowerSync SQLite core extension to 0.3.12. + ## 1.0.0-BETA27 * Improved watch query internals. Added the ability to throttle watched queries. diff --git a/core/src/commonIntegrationTest/kotlin/com/powersync/SyncIntegrationTest.kt b/core/src/commonIntegrationTest/kotlin/com/powersync/SyncIntegrationTest.kt index e66e0882..eee94854 100644 --- a/core/src/commonIntegrationTest/kotlin/com/powersync/SyncIntegrationTest.kt +++ b/core/src/commonIntegrationTest/kotlin/com/powersync/SyncIntegrationTest.kt @@ -267,6 +267,51 @@ class SyncIntegrationTest { turbine.cancel() } + database.close() + syncLines.close() + } + + @Test + fun testMultipleSyncsDoNotCreateMultipleStatusEntries() = + runTest { + val syncStream = syncStream() + database.connect(syncStream, 1000L) + + turbineScope(timeout = 10.0.seconds) { + val turbine = database.currentStatus.asFlow().testIn(this) + turbine.waitFor { it.connected && !it.downloading } + + repeat(5) { + syncLines.send( + SyncLine.FullCheckpoint( + Checkpoint( + lastOpId = "1", + checksums = + listOf( + BucketChecksum( + bucket = "bkt", + checksum = 0, + ), + ), + ), + ), + ) + turbine.waitFor { it.downloading } + + syncLines.send(SyncLine.CheckpointComplete(lastOpId = "1")) + turbine.waitFor { !it.downloading } + + val rows = + database.getAll("SELECT * FROM ps_sync_state;") { + it.getString(1)!! + } + + assertEquals(1, rows.size) + } + + turbine.cancel() + } + database.close() syncLines.close() } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a4db612f..abb27c99 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,7 +15,7 @@ kotlinx-datetime = "0.5.0" kotlinx-io = "0.5.4" ktor = "3.0.1" uuid = "0.8.2" -powersync-core = "0.3.11" +powersync-core = "0.3.12" sqlite-android = "3.45.0" sqlite-jdbc = "3.45.2.0" turbine = "1.2.0"