OfflineMutationTypedLink constructor

OfflineMutationTypedLink({
  1. required Box<Map<String, dynamic>?> mutationQueueBox,
  2. required Serializers serializers,
  3. required Cache cache,
  4. required StreamController<OperationRequest> requestController,
  5. LinkExceptionHandler? linkExceptionHandler,
})

OfflineMutationPlugin can be used to maintain an Offline Mutation queue.

This plugin is intended to be an example for how offline mutations can be handled with ferry but doesn't address all edge cases.

Some limitations include:

  1. If the client shuts down during an inflight mutation (i.e. after a mutation has been sent to the server but before a response has been received), the mutation is assumed to have completed succesfully.
  2. When coming back online, all queued mutations are executed immediately in parallel, not serially. This could lead to unexpected behavior.

Implementation

OfflineMutationTypedLink({
  required this.mutationQueueBox,
  required this.serializers,
  required this.cache,
  required this.requestController,
  this.linkExceptionHandler,
});