Skip to content

Commit 2cc8001

Browse files
committed
Rename priorityStatusFor to statusForPriority
This ensures consistency with the JS and Dart SDKs.
1 parent 948018a commit 2cc8001

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class SyncIntegrationTest {
177177
),
178178
)
179179

180-
turbine.waitFor { it.priorityStatusFor(priority).hasSynced == true }
180+
turbine.waitFor { it.statusForPriority(priority).hasSynced == true }
181181
expectUserCount(priorityNo + 1)
182182
}
183183

@@ -224,7 +224,7 @@ class SyncIntegrationTest {
224224
// Connect to the same database again
225225
database = openDb()
226226
assertFalse { database.currentStatus.hasSynced == true }
227-
assertTrue { database.currentStatus.priorityStatusFor(BucketPriority(1)).hasSynced == true }
227+
assertTrue { database.currentStatus.statusForPriority(BucketPriority(1)).hasSynced == true }
228228
database.close()
229229
syncLines.close()
230230
}

core/src/commonMain/kotlin/com/powersync/db/PowerSyncDatabaseImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ internal class PowerSyncDatabaseImpl(
342342
if (priority == null) {
343343
{ it.hasSynced == true }
344344
} else {
345-
{ it.priorityStatusFor(priority).hasSynced == true }
345+
{ it.statusForPriority(priority).hasSynced == true }
346346
}
347347

348348
if (predicate(currentStatus)) {

core/src/commonMain/kotlin/com/powersync/sync/SyncStatus.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public interface SyncStatusData {
8585
/**
8686
* Status information for whether buckets in [priority] have been synchronized.
8787
*/
88-
public fun priorityStatusFor(priority: BucketPriority): PriorityStatusEntry {
88+
public fun statusForPriority(priority: BucketPriority): PriorityStatusEntry {
8989
val byDescendingPriorities = priorityStatusEntries.sortedByDescending { it.priority }
9090

9191
for (entry in byDescendingPriorities) {

core/src/commonTest/kotlin/com/powersync/sync/SyncStreamTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ class SyncStreamTest {
286286
),
287287
)
288288

289-
turbine.waitFor { it.priorityStatusFor(priority).hasSynced == true }
289+
turbine.waitFor { it.statusForPriority(priority).hasSynced == true }
290290

291291
verifySuspend(order) {
292292
if (priorityNo == 0) {

demos/android-supabase-todolist/app/src/main/java/com/powersync/androidexample/screens/HomeScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ internal fun HomeScreen(
6666
// When giving lists a higher priority than items, we can have a consistent snapshot of
6767
// lists without items. In the case where many items exist (that might take longer to
6868
// sync initially), this allows us to display lists earlier.
69-
if (status.priorityStatusFor(BucketPriority(1)).hasSynced == true) {
69+
if (status.statusForPriority(BucketPriority(1)).hasSynced == true) {
7070
ListContent(
7171
items = items,
7272
onItemClicked = onItemClicked,

0 commit comments

Comments
 (0)