Skip to content

cleanup realtime state machine and support live references#202

Open
noahgsolomon wants to merge 3 commits intomainfrom
noah/cleanup-realtime-state-machine
Open

cleanup realtime state machine and support live references#202
noahgsolomon wants to merge 3 commits intomainfrom
noah/cleanup-realtime-state-machine

Conversation

@noahgsolomon
Copy link
Contributor

@noahgsolomon noahgsolomon commented Feb 25, 2026

Remove unreachable failed state and unused expireToken
transition. Fix reuseInterpreter to store the actual robot3
service instead of a spread copy, so context and machine
references stay live across state transitions.

The active state had no handler for token expiry, so tokens
were never refreshed. Replace the broken expireToken approach
with a recurring background fetch that updates the token
in-place via a new authenticated transition, keeping the
WebSocket open. Use a generation counter to prevent stale
callbacks from spawning parallel refresh loops. Also expire
the token on connectionClosed and close so reconnects always
re-authenticate instead of reusing a stale token.
interpreter reference

Remove unreachable failed state and unused expireToken
transition from idle. Store the real robot3 service
in the interpreter cache instead of a spread copy so
context and machine state are always live.
@noahgsolomon noahgsolomon changed the title Noah/cleanup realtime state machine cleanup realtime state machine with live references Feb 25, 2026
@noahgsolomon noahgsolomon changed the title cleanup realtime state machine with live references cleanup realtime state machine and support live references Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant