Package-level declarations

Functions

Link copied to clipboard

The outcome of a write the server applied, as a test double of the app's own returns it.

Link copied to clipboard
fun cachedFile(path: String, fetchedAt: Instant, sizeBytes: Long): CachedFile

A Storage object held in the file cache, as the offline bucket reports one.

Link copied to clipboard
fun cacheMissException(message: String = "No valid cached data found for this query"): CacheMissException

The failure of a read that may use only the cache and found nothing there.

Link copied to clipboard
fun Offline.Config.inMemory(clock: Clock = Clock.System)

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:

Link copied to clipboard
fun mutationNotQueueableException(cause: Throwable, message: String = "The write could not be queued, and could not be sent"): MutationNotQueueableException

The failure of a write the mutation queue could not hold, sent at once and refused for want of a connection.

Link copied to clipboard
fun networkDisabledException(message: String = "The library's network access is turned off"): NetworkDisabledException

The failure of a request asked for while the app had turned the library's network access off.

Link copied to clipboard
fun pendingMutation(id: Long, table: String, operation: MutationOperation, createdAt: Instant, rowKeys: List<JsonObject> = emptyList(), body: JsonElement? = null): PendingMutation

A write waiting in the mutation queue, as Offline.pendingMutations lists one.

Link copied to clipboard
fun querySnapshot(result: PostgrestResult?, isFromCache: Boolean, fetchedAt: Instant?, hasPendingMutations: Boolean = false, refresh: RefreshState = RefreshState.Idle): QuerySnapshot

One emission of a reactive read, as selectAsFlow hands one out.

Link copied to clipboard

The outcome of a write that waits in the mutation queue.

Link copied to clipboard
fun rejectedMutation(id: Long, table: String, operation: MutationOperation, createdAt: Instant, rowKeys: List<JsonObject> = emptyList(), body: JsonElement? = null, serverError: ServerError? = null, message: String, rejectedAt: Instant, isRetryable: Boolean = true): RejectedMutation

A queued write the server refused for good, as Offline.rejectedMutations lists one.

Link copied to clipboard
fun serverError(status: Int, code: String? = null, message: String, details: String? = null, hint: String? = null): ServerError

What the server answered when it refused a write.

Link copied to clipboard

The state of a refresh that keeps failing.

Link copied to clipboard
fun syncFailedException(message: String = "The sync pass stopped with writes still queued", httpStatus: Int? = null, code: String? = null, isConnectivityFailure: Boolean = false): SyncFailedException

Why a sync pass stopped with writes still queued, as SyncStatus.lastSyncError reports it.

Link copied to clipboard
fun syncReport(syncedCount: Int, rejected: List<RejectedMutation> = emptyList(), remainingCount: Int = 0, alreadyOnServerCount: Int = 0, heldBehindOtherTablesCount: Int = 0): SyncReport

What a call of Offline.syncPendingMutations did.

Link copied to clipboard
fun syncStatus(network: NetworkStatus = NetworkStatus.UNKNOWN, pendingMutationCount: Int = 0, rejectedMutationCount: Int = 0, isSyncing: Boolean = false, lastSyncedAt: Instant? = null, lastSyncError: SyncFailedException? = null): SyncStatus

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.