File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
core/src/commonMain/kotlin/com/powersync/bucket Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 1.0.0-BETA12
4+
5+ * Use transaction context in ` writeTransaction ` in ` BucketStorageImpl ` to avoid race condition issues in Swift SDK.
6+
37## 1.0.0-BETA11
48
59* Update version to fix deployment issue of previous release
Original file line number Diff line number Diff line change @@ -93,14 +93,14 @@ internal class BucketStorageImpl(
9393
9494 logger.i { " [updateLocalTarget] Updating target to checkpoint $opId " }
9595
96- return db.writeTransaction {
96+ return db.writeTransaction { tx ->
9797 if (hasCrud()) {
9898 logger.w { " [updateLocalTarget] ps crud is not empty" }
9999 return @writeTransaction false
100100 }
101101
102102 val seqAfter =
103- db .getOptional(" SELECT seq FROM sqlite_sequence WHERE name = '${InternalTable .CRUD } '" ) {
103+ tx .getOptional(" SELECT seq FROM sqlite_sequence WHERE name = '${InternalTable .CRUD } '" ) {
104104 it.getLong(0 )!!
105105 }
106106 ? : // assert isNotEmpty
@@ -112,7 +112,7 @@ internal class BucketStorageImpl(
112112 return @writeTransaction false
113113 }
114114
115- db .execute(
115+ tx .execute(
116116 " UPDATE ${InternalTable .BUCKETS } SET target_op = CAST(? as INTEGER) WHERE name='\$ local'" ,
117117 listOf (opId),
118118 )
You can’t perform that action at this time.
0 commit comments