ConnectionStateHolder
Owns canonical connection state, epochs, and compatibility projections under one publication lock.
Constructors
Properties
Convenience view of monotonic departures and completed handshakes. Use connectionLifecycle when the counters must be correlated with a specific state, because independent StateFlow collections can observe different versions.
Atomically correlated canonical state and lifecycle evidence.
Canonical app-level connection state.
Functions
Restores a known state, primarily for reusable test fakes. Epoch counters remain monotonic: omitting epochs applies the canonical transition into state, while an explicit value may only advance the counters. The publication version always advances so readers can distinguish the reset from the preceding snapshot.
Applies newState and advances epochs exactly once when the state changes.