Package-level declarations
Types
The server's row changes a test reports to an in-memory client, in place of a Realtime channel:
The local data of in-memory clients, kept from one client to the next, for a test of what an app does after a restart: the cache, the mutation queue with the rejected and conflicted lists, and the Storage file cache. Hand the same store to each client's inMemory:
Functions
The outcome of a write the server applied, as a test double of the app's own returns it.
The outcome of an upload Storage stored, as a test double of the app's own returns it.
A Storage object held in the file cache, as the offline bucket reports one.
The result of a one-shot read the cache answered, as a fake of the app's own repository returns it: PostgrestResult.isFromCache reads true, PostgrestResult.fetchedAt the time given, to the millisecond, and PostgrestResult.hasPendingMutations the flag given. The library stamps a read's result in headers PostgREST never sends, and this one carries the same stamp; a result built with PostgrestResult(data, Headers.Empty, supabase.postgrest) carries none, and reads as a result supabase-kt returned itself.
The result of a one-shot read the cache answered that names the rows a queued write changed: cachedResult, with PostgrestResult.pendingRowKeys reading pendingRowKeys and PostgrestResult.hasPendingMutations reading true exactly when it is not empty.
The failure of a read that may use only the cache and found nothing there.
A write parked on the conflicted list, as Offline.conflictedMutations lists one.
The progress of a download into the file cache, as ensureCachedFile with a progress callback reports it.
Keeps the plugin's local data in memory, for tests: the cache, the mutation queue and the Storage file cache live in the client, and nothing is written to disk. Every other setting applies as it does in an app, so a test builds its client exactly as production does:
inMemory, with the server's row changes reported by realtime in place of a Realtime channel, so a test of an app that names tables in realtime { } needs no install(Realtime):
inMemory, over store: the client starts with what an earlier client over store left there (the queued writes, which it replays, the rejected and conflicted lists, the cached queries and files) and leaves its own there when it closes. A test closes one client and builds the next to see what the app does after it is killed and relaunched:
inMemory over store, as the overload that takes a store alone, with the server's row changes reported by realtime in place of a Realtime channel, as the overload that takes a FakeRealtime alone.
The reason of a sync call a failure on the device stopped, such as the local database failing.
A conflict a replay found, as a ConflictResolver is shown one, for a test of the app's own resolver.
The failure of a write the mutation queue could not hold, sent at once and refused for want of a connection.
The failure of a request asked for while the app had turned the library's network access off.
The failure of a call on a closed client, with the library's own message and no cause, as a test double of the app's own throws it after its client is closed.
A write waiting in the mutation queue, as Offline.pendingMutations lists one.
A write waiting in the mutation queue with the version it replays against, as Offline.pendingMutations lists a write to a table with a version column.
An upload waiting in the mutation queue, as OfflineStorage.pendingUploads lists one.
One emission of a reactive read, as selectAsFlow hands one out.
One emission of a reactive read that names the rows a queued write changed, as selectAsFlow hands one out: QuerySnapshot.pendingRowKeys reads pendingRowKeys, and QuerySnapshot.hasPendingMutations reads true exactly when it is not empty, as the library's own snapshot does when each row changed carries its key. For a write that changed a row without a key to name, build the snapshot with the other querySnapshot and hasPendingMutations = true.
The outcome of a write that waits in the mutation queue.
The outcome of an upload that waits in the mutation queue.
A queued write the server refused for good, as Offline.rejectedMutations lists one.
A queued upload Storage refused for good, as OfflineStorage.rejectedUploads lists one.
A queued upload Storage refused for good, with its bytes on the device at localPath, as OfflineStorage.rejectedUploads lists one whose file is still whole.
What the server answered when it refused a write.
The reason of a sync call the server stopped with a failure that may pass, such as a 503.
The state of a Realtime channel whose join was refused or that ended, which the client joins again.
The state of a refresh that keeps failing.
Why a sync pass stopped with writes still queued, as SyncStatus.lastSyncError reports it.
What a call of Offline.syncPendingMutations did. Its SyncReport.stopReason is the one the library gives such a report: SyncStopReason.HeldBehindOtherTables when heldBehindOtherTablesCount is more than zero, else SyncStopReason.Completed.
What a call of Offline.syncPendingMutations did, with the conflicts its replay met; a test sets the conflict fields it reads, and the others keep the values of a pass that met none. Its SyncReport.stopReason is the one the library gives such a report: SyncStopReason.HeldBehindOtherTables when heldBehindOtherTablesCount is more than zero, else SyncStopReason.Completed.
What a call of Offline.syncPendingMutations did, and why it returned when it did; every field but stopReason, which selects this overload, defaults to the value of a call that sent nothing. Build a failure's reason with serverFailureStop or localFailureStop; the others are objects, such as SyncStopReason.NetworkUnavailable.
What a call of Offline.syncPendingMutations did, with the queued uploads Storage refused; every field but rejectedUploads, which selects this overload, defaults to the value of a call that sent nothing and ran to the end.
Where the library stands with the queue and the network, as Offline.syncStatus holds it; every field defaults to the state of a client that has done nothing yet and has counted its queue: nothing waiting, SyncStatus.isQueueCounted true. For the value a client starts with, before its first count, give isQueueCounted = false, which selects the third overload.
Where the library stands with the queue and the network, the conflicted list included; every field but conflictedMutationCount, which selects this overload, defaults to the state of a client that has done nothing yet and has counted its queue.
Where the library stands with the queue and the network, saying whether the queue has been counted; every field but isQueueCounted, which selects this overload, defaults to the state of a client that has done nothing yet. syncStatus(isQueueCounted = false) is the value a client starts with, before its first count.