Oko/Docs

Command reference

oko asks wait

Returns once a waiting ask is answered, withdrawn or expired, so the product that asked can act on the answer given in Oko Desktop or Oko iOS. The change is learned from the database as it is written (Supabase Realtime on oko_operator_asks), not by asking again on a clock; an ask that already stopped waiting returns at once.

Invocation#

Command
oko asks wait <id>

Inputs and options#

  • The ask id.
  • Example: a Weles run that asked `--choice approved --choice not_received` runs `oko asks wait <id>` beside its own wait and acts on `ask.answer`.

Output and state effect#

  • Prints `{ask, standing, deliveries}` as `oko asks show` does. Sets no timer: Realtime closes a subscription when the session's token expires or the socket goes without a heartbeat, and each close is followed by a new subscription with a fresh token that reads the row once it is open, so no change is missed; an ask past its expires_at is returned as expired at the next close.

Refusals and safe exits#

  • `oko asks wait requires <id>` (exit 2); `<email> has no ask <id>; `oko asks list` names every ask put to them`.
  • `the shared database's Realtime socket could not be opened to wait on ask <id>: <error>`; `the shared database refused to stream changes of ask <id>: <response>`; `the Realtime channel of ask <id> failed: <payload>`. A system error before the server accepted the subscription refuses the token the join was sent (one with seconds left can expire on its way, the server's `Token has expired 0 seconds ago`): stderr says `the Realtime channel of ask <id> refused its token (<message>); joining again with a fresh one`, the token is exchanged as a REST read exchanges one after `JWT expired`, and the join is sent once more; only a second refusal, with the token just exchanged, ends the wait as `the Realtime channel of ask <id> reported an error: <message>, after a fresh token too (first: <message>)`. After the server accepted it, the same system error ends that subscription: stderr says `the Realtime channel of ask <id> ended: <message>; subscribing again` and the wait continues with a fresh token. `the shared database closed the Realtime socket before it accepted the wait on ask <id>; the ask still waits`; `the database address <url> is neither https nor http`.

CLI reference#