File tree Expand file tree Collapse file tree 4 files changed +20
-2
lines changed
commonIntegrationTest/kotlin/com/powersync/sync
commonMain/kotlin/com/powersync/sync Expand file tree Collapse file tree 4 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 66* Add ` rawConnection ` getter to ` ConnectionContext ` , which is a ` SQLiteConnection ` instance from
77 ` androidx.sqlite ` that can be used to step through statements in a custom way.
88
9+ ## 1.5.1
10+
11+ * Fix issue in legacy sync client where local writes made offline could have their upload delayed
12+ until a keepalive event was received. This could also cause downloaded updates to be delayed even
13+ further until all uploads were
14+ completed.
15+ * [ Internal] Update core extension to 0.4.5
16+
917## 1.5.0
1018
1119* Add ` PowerSyncDatabase.getCrudTransactions() ` , returning a flow of transactions. This is useful
Original file line number Diff line number Diff line change @@ -612,7 +612,6 @@ abstract class BaseSyncIntegrationTest(
612612 database.watch(" SELECT name FROM users" ) { it.getString(0 )!! }.testIn(scope)
613613 query.awaitItem() shouldBe listOf (" local write" )
614614
615- syncLines.send(SyncLine .KeepAlive (tokenExpiresIn = 1234 ))
616615 syncLines.send(
617616 SyncLine .FullCheckpoint (
618617 Checkpoint (
Original file line number Diff line number Diff line change @@ -536,9 +536,20 @@ internal class SyncStream(
536536 lateinit var receiveLines: Job
537537 receiveLines =
538538 scope.launch {
539+ var hadLine = false
539540 receiveTextLines(JsonUtil .json.encodeToJsonElement(req)).collect { value ->
540541 val line = JsonUtil .json.decodeFromString<SyncLine >(value)
541542
543+ if (! hadLine) {
544+ // Trigger a crud upload when receiving the first sync line: We could have
545+ // pending local writes made while disconnected, so in addition to listening on
546+ // updates to `ps_crud`, we also need to trigger a CRUD upload in some other
547+ // cases. We do this on the first sync line because the client is likely to be
548+ // online in that case.
549+ hadLine = true
550+ triggerCrudUploadAsync()
551+ }
552+
542553 state = handleInstruction(line, value, state)
543554
544555 if (state.abortIteration) {
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ development=true
1919RELEASE_SIGNING_ENABLED =true
2020# Library config
2121GROUP =com.powersync
22- LIBRARY_VERSION =1.5.0
22+ LIBRARY_VERSION =1.5.1
2323GITHUB_REPO =https://github.com/powersync-ja/powersync-kotlin.git
2424# POM
2525POM_URL =https://github.com/powersync-ja/powersync-kotlin/
You can’t perform that action at this time.
0 commit comments