Understand realtime session lifecycle and states
mainEvery realtime session follows a consistent lifecycle regardless of the underlying protocol. This allows applications to use a single status indicator for multiple models.
States:
"opening": The initial state during negotiation."live": The session is active and the transport is ready."failed": A terminal state indicating a transport error. Note:failedtakes precedence overclosedif a session dies."closed": A terminal state indicating the session was intentionally ended.
Diagnostics:
For fine-grained details (like progress or specific error messages), use the onDiagnostic callback. Diagnostics use a RealtimeDiagnostic type with kind values of "progress", "warning", or "failure".