Skip to content

Extract CallWaveCallStateMachine from CallWaveClient - #22

Merged
PetrShtuka merged 1 commit into
mainfrom
refactor/call-state-machine
Aug 19, 2026
Merged

Extract CallWaveCallStateMachine from CallWaveClient#22
PetrShtuka merged 1 commit into
mainfrom
refactor/call-state-machine

Conversation

@PetrShtuka

Copy link
Copy Markdown
Owner

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.

@PetrShtuka
PetrShtuka merged commit dea10cc into main Aug 19, 2026
4 checks passed
@PetrShtuka
PetrShtuka deleted the refactor/call-state-machine branch August 21, 2026 09:20
PetrShtuka added a commit that referenced this pull request Aug 23, 2026
Co-authored-by: PeterSthuka <pitmailcom@gmail.com>
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.
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