Skip to content

States, events, and errors

StateSDK instanceRetry behavior
acceptedPresentConnect once and wait for online
declinedAbsentRespect decision; no prompt loop
revokedAbsentRemain disabled for current scope
cancelledAbsentAllow deliberate future retry
errorAbsentCorrect configuration or show support path

The native runtime can move through:

  • Idle: no supervisor running.
  • Discovering: runtime onboarding is in progress.
  • ConnectingTransport: authentication and transport setup are in progress.
  • Online: owner connection is active.
  • Backoff: waiting before a policy-driven retry.
  • BatteryPaused: paused by battery policy.
  • Disconnecting: shutdown requested.
  • Closed: terminal; cannot reconnect.

Most wrappers expose connected/disconnected events and isOnline, not every internal phase.

ReasonMeaningApplication response
ManualApplication requested disconnectUpdate state; no error UI required
NetworkConnectivity failedShow offline if relevant; allow SDK policy to retry
ServerUnavailableService unavailableRecord sanitized event; avoid tight retry loop
TokenExpiredRuntime session requires refreshSDK can perform a new connection attempt
LowBatteryAssigned policy paused participationRespect policy; do not override
DiscoveryErrorControl-plane setup failedCheck API key, consent state, time, and network
ProtocolErrorIncompatible or invalid exchangeVerify package versions and contact support
UnknownUnrecognized or unmapped reasonPreserve numeric/raw category for support without secrets

Native ABI provides error code, retryability, disconnect reason, and a short message. Managed wrappers map these into typed errors where possible.

Unknown positive native error codes must become generic SDK failures, not success. Unknown disconnect values must map to Unknown so applications remain forward-compatible.

Retryable does not mean “retry immediately from application code.” The supervisor owns connection retry. Application-level retry is appropriate for explicit creation, package/configuration correction, or a failed user revoke after showing feedback.

The C ABI last-error message is thread-local and temporary. Read and copy it immediately after a failed native call before any other SDK call on that thread.