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.
| Signal | Show |
|---|---|
IsLoading with LoadError | The first load failed: a message and a Retry that reopens the screen |
A command's ProjectVResult.IsSuccess is false | Message 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:
| Signal | Show |
|---|---|
HasUsableData | Keep the screen populated |
Phase is Offline, Cached, Stale or Partial | A small offline or partial indicator |
CanRetry | A Retry button that calls the same refresh |
CanSync | A Sync button |
RetryAfterSeconds | Disable Retry until that time passes |
Status is Purchasing, Mutating or Beginning | Disable 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.