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-BETA12

* Use transaction context in `writeTransaction` in `BucketStorageImpl` to avoid race condition issues in Swift SDK.

## 1.0.0-BETA11

* Update version to fix deployment issue of previous release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ internal class BucketStorageImpl(

logger.i { "[updateLocalTarget] Updating target to checkpoint $opId" }

return db.writeTransaction {
return db.writeTransaction { tx ->
if (hasCrud()) {
logger.w { "[updateLocalTarget] ps crud is not empty" }
return@writeTransaction false
}

val seqAfter =
db.getOptional("SELECT seq FROM sqlite_sequence WHERE name = '${InternalTable.CRUD}'") {
tx.getOptional("SELECT seq FROM sqlite_sequence WHERE name = '${InternalTable.CRUD}'") {
it.getLong(0)!!
}
?: // assert isNotEmpty
Expand All @@ -112,7 +112,7 @@ internal class BucketStorageImpl(
return@writeTransaction false
}

db.execute(
tx.execute(
"UPDATE ${InternalTable.BUCKETS} SET target_op = CAST(? as INTEGER) WHERE name='\$local'",
listOf(opId),
)
Expand Down
Loading