Extract CallWaveCallStateMachine from CallWaveClient - #22
Merged
Conversation
PetrShtuka
added a commit
that referenced
this pull request
Aug 23, 2026
PetrShtuka
pushed a commit
that referenced
this pull request
Aug 24, 2026
main extracted CallWaveCallStateMachine (#22), which took `callState`, `currentCallUUID`, `currentCaller` and `microphoneMuted` out of CallWaveClient — the four properties this branch had just put behind a lock. Git kept both sides, leaving two implementations of each getter. The lock moves to where the state now lives. The client keeps its own for what stayed (`configuration`, `provider`, `running`, `registrationState`, `registrationError`, `defaultCallerName`, `pushPayloadParser`, `networkPathSummary`), and the state machine gets the same treatment for the projection, which is still read from any thread: -resolveCallForUUID: backs every argument-less call action, and the client's pass-throughs go straight to its ivars. -clearPublishedCallState is dropped in favour of -resetToIdle; -stop and -providerDidReset: keep the main-queue hop this branch added. Projection writes go through one -setProjectionUUID:caller:muted:, so a reader cannot catch the UUID and the caller name out of step. The concurrency test grew a case that drives the machine's writers directly, and it earned its keep immediately: the first version of this resolution implemented -microphoneMuted while the property declares getter=isMicrophoneMuted, so the real getter stayed auto-synthesized and unlocked. TSan reported it against the new test. Verified: 131 tests, TSan clean, device and strict-concurrency builds, podspec lint. The CHANGELOG's Unreleased section is re-sorted — the merge had put the data-race entry under Added.
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.
Per-call state transitions and the current-call projection (state, UUID, caller, mute) moved out of CallWaveClient into a new internal CallWaveCallStateMachine with a delegate protocol. Behaviour verbatim, public API unchanged. Tests: 113/113 passed (56 Registry + 57 Kit), unmodified. CHANGELOG updated. Closes the state-machine half of the coordinator refactor; audio coordinator landed in #21.