Repository navigation
refactor(ios-runner): give runner sessions a lifecycle state - #2673
Conversation
Size Report
Startup median (7 runs, lower is better):
|
|
Reviewed 6e3db18. The state change itself looks right: The new tests in One design question: do the three liveness readers need to stay separate? Not blocking: This changes how the iOS runner session starts, is reused and is disposed, so it needs live evidence. #2662 asks for the iOS simulator and macOS host lanes green on this commit, Smoke Tests was still running when I looked. This diff runs through its path ( |
6e3db18 to
e559ccb
Compare
The session ready boolean mixed the runner answer with process existence, and three readers combined them three ways. A session now records whether it has answered and whether disposal has begun, while the process probe remains a separate fact. Both feed one liveness answer and one idempotence guard. (#2662)
e559ccb to
4b77eee
Compare
|
Pushed Design question. Yes. Production-route coverage.
Readiness tests moved to Live evidence. On iPhone 17 Pro (iOS 26.2), |
|
Reviewed 4b77eee. Both points from the earlier review are done. The reported iPhone 17 Pro run reaches the changed routes: startup, the first answer, an idle stop with no invalidation, and a fresh reopen. It has no snapshot step, but the Two optional notes. The test "stop and invalidate do not start a second disposal" (https://github.com/callstack/agent-device/blob/4b77eee/packages/platform-apple/src/runner/__tests__/runner-session-lifecycle.test.ts#L265) stays green without the new guard in The PR body does not yet have the line about recording start refusing starting and draining sessions, and draining sessions taking the not-ready preflight path. All checks pass on 4b77eee and there are no conflicts. This is ready for a human review. |
|
Summary
Needed for #2662. 34 files, with no CLI, Node, or MCP surface change.
A runner session's
readyboolean conflated "has answered" with "process exists". Sessions now move throughstarting,ready,draining, andstopped, whilereadRunnerSessionLivenessis the sole reader combining that state with the process probe. Startup, reuse, repeated stop/invalidate, abort, detach, recycle, late answers, and status consumers now use one model.The new lifecycle and readiness tests drive production routes and check transition order, one disposal, draining refusal, abort/detach cleanup, and recycling after process death.
Validation
4b77eeefe32de5d6c237c162ac61deda53e8c74c.pnpm check:affected --run: 365 files and 2,436 tests passed.pnpm check:xctest-selection: passed; TypeScript-only.--debug: startup ranuptimeand answered as commandrunner-f2b89e7f-a63b-4ec4-9acd-baa27bc1982cwithsessionReady=false; retainedcloseemittedios_runner_idle_stopafter the 2-second window andios_runner_session_invalidatedappeared zero times. A second open started and answered a fresh runner.device status --jsonoutputs are identical after normalizing session, UDID, workspace, state directory, PID, and timestamp.