[AIT-672] transport: introduce explicit state enums for transport and turn lifecycle#52
Open
lawrence-forooghian wants to merge 3 commits intomainfrom
Open
[AIT-672] transport: introduce explicit state enums for transport and turn lifecycle#52lawrence-forooghian wants to merge 3 commits intomainfrom
lawrence-forooghian wants to merge 3 commits intomainfrom
Conversation
Introduce an internal ClientTransportState enum with READY and CLOSED cases, replacing the _closed boolean field. This establishes the infrastructure for an explicit state machine, matching our other SDKs and giving us a structure within which to introduce further states in the future. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Free the TurnState name for the turn lifecycle state enum being added in the next commit. The interface describes an entry in the _activeTurns map, so ActiveTurnsEntry is a better fit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the two boolean flags (started, ended) tracking server turn lifecycle with an explicit TurnState enum (INITIALIZED → STARTED → ENDED). This makes valid transitions self-documenting and prevents impossible states, consistent with how Ably's other SDKs model lifecycle and with the ClientTransportState enum added in c13618c. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_closedboolean inClientTransportwith aClientTransportStateenum (READY,CLOSED)started/endedbooleans in serverTurnwith aTurnStateenum (INITIALIZED,STARTED,ENDED)TurnStateinterface inTurnManagertoActiveTurnsEntryto free the nameEstablishes infrastructure for explicit state machines, following the pattern used by Ably channels and chat rooms. No behaviour change — all existing guards are mechanically mapped to the new enums.
🤖 Generated with Claude Code