Sync remote state

How and how often to refresh the controls map and block decision.

Two things need to stay fresh: the block decision (kill-switch) and the resolved controls map. Flag rulesets change less often but follow the same shape.

When to refresh

  1. On app launch, always. Call /session then read controls.
  2. On resume from background — do the same.
  3. Optionally, on a periodic timer (60s is a good default for foreground apps).

Delta sync

For controls, prefer /controls/delta?since=<iso>. The server returns a fresh snapshot (with snapshot: true) whenever anything changed since your cursor, so clients simply replace the local map.

Offline behavior

  • Cache the last block decision and controls map to storage.
  • On startup, apply the cached decision before the network completes — a killed app must stay blocked even offline.
Back to top