Skip to content

Commit e52fa22

Browse files
committed
Add test and changelog entry
1 parent 654d848 commit e52fa22

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 1.0.0-BETA31
44

55
* Added helpers for Attachment syncing.
6+
* Fix `getNextCrudTransaction()` only returning a single item.
67

78
## 1.0.0-BETA30
89

core/src/commonIntegrationTest/kotlin/com/powersync/DatabaseTest.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,4 +369,25 @@ class DatabaseTest {
369369
val count = database.get("SELECT COUNT(*) from people") { it.getLong(0)!! }
370370
count shouldBe 1
371371
}
372+
373+
@Test
374+
fun testCrudTransaction() =
375+
databaseTest {
376+
database.execute("INSERT INTO users (id, name, email) VALUES (uuid(), ?, ?)", listOf("a", "[email protected]"))
377+
378+
database.writeTransaction {
379+
it.execute("INSERT INTO users (id, name, email) VALUES (uuid(), ?, ?)", listOf("b", "[email protected]"))
380+
it.execute("INSERT INTO users (id, name, email) VALUES (uuid(), ?, ?)", listOf("c", "[email protected]"))
381+
}
382+
383+
var transaction = database.getNextCrudTransaction()
384+
transaction!!.crud shouldHaveSize 1
385+
transaction.complete(null)
386+
387+
transaction = database.getNextCrudTransaction()
388+
transaction!!.crud shouldHaveSize 2
389+
transaction.complete(null)
390+
391+
database.getNextCrudTransaction() shouldBe null
392+
}
372393
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ development=true
1717
RELEASE_SIGNING_ENABLED=true
1818
# Library config
1919
GROUP=com.powersync
20-
LIBRARY_VERSION=1.0.0-BETA30
20+
LIBRARY_VERSION=1.0.0-BETA31
2121
GITHUB_REPO=https://github.com/powersync-ja/powersync-kotlin.git
2222
# POM
2323
POM_URL=https://github.com/powersync-ja/powersync-kotlin/

0 commit comments

Comments
 (0)