Skip to main content

Offline and recovery

The SDK retries, reconnects and resynchronises on its own. A screen only has to show the state it is told about.

Screen contracts​

A view always keeps the last confirmed data, so nothing goes blank when the network drops.

SignalShow
IsLoading with LoadErrorThe first load failed: a message and a Retry that reopens the screen
A command's ProjectVResult.IsSuccess is falseMessage as it is

If a level-up or other Character/Alliance command could not be confirmed, those screens resynchronise and redraw by themselves; do not add a Sync button for that. If a Shop purchase could not be confirmed, show the message and do not buy again automatically: the purchase may have gone through.

Presenters with Recovery​

Data snapshots carry a ProjectVScreenRecoveryState as Recovery:

SignalShow
HasUsableDataKeep the screen populated
Phase is Offline, Cached, Stale or PartialA small offline or partial indicator
CanRetryA Retry button that calls the same refresh
CanSyncA Sync button
RetryAfterSecondsDisable Retry until that time passes
Status is Purchasing, Mutating or BeginningDisable the button that started it

Rules​

  • Never resend a purchase, upgrade or claim because it timed out. Show the message and let the player retry once the screen has updated.
  • Never compute balances from purchase or reward amounts.
  • Never write a retry loop in a view.

See also Errors and safe retry.