Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading