decodeOptimisticSnapshot property

T Function(Object? snapshot)? decodeOptimisticSnapshot
final

Decodes a persisted optimistic snapshot (see mutate) back into a T during recoverPendingMutations.

Provide this when mutations are enqueued with optimisticSnapshot: replay then sends the exact pre-death value instead of re-deriving apply(currentCached) — which can double-apply base-dependent mutations (increments, appends) after a crash. If a record carries a snapshot but no codec is configured, recovery reports the record via SyncacheObserver.onOutboxReplayFailed rather than silently falling back.

Implementation

final T Function(Object? snapshot)? decodeOptimisticSnapshot;