Repository navigation
fix(daemon): resolve an explicit selector for the bound device from the session - #4645
Conversation
…he session An explicit --udid/--serial/--device that names the device the session is bound to no longer re-reads the simulator inventory (~256 ms per command). A selector naming another device, a stale UDID, and the device pin still refuse as before. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
… as well The explicit-selector fast path has no inventory read, so the retirement test now covers both resolution points: an inventory read for another device, and runner observation for the bound one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
I found no code problems in 67366c8, and the PR is ready from review. CI was still queued or running on all eight jobs when I looked, so wait for Smoke Tests, Integration Tests and Coverage, which overlap |
Summary
An explicit
--udid/--serial/--devicethat names the device the session is already bound to now resolves from the session, like an unselected request, with no inventory read.snapshotwas already cheap because its handler readssession.devicedirectly (selector conflicts are refused earlier byassertSessionSelectorMatches);resolveCommandDevicealone forced an inventory read for every explicit selector.Refusals are kept:
DEVICE_NOT_FOUND. It is never replaced by a same-name simulator, so the session-only rename fallback is off for explicit selectors.require-ownerguard only runs for a fresh session.2 files touched (+121/−6, of which 98 are tests). Closes #4643.
Validation
Source head
85dace3bda. Base26a8a1b301(main).Unit:
session-device-resolution.test.tspasses (20). Without the fix, the matching-selector test and the pin test fail. The mismatch and stale-UDID tests pass on both, as intended.tsc,oxlintandoxfmt --checkare clean. CI validates the rest.Live: iPhone 17e simulator (iOS 27.0), warm daemon, private state dir per CLI, Wallet app, n=8 wall-clock medians in ms.
presstaps coordinates on the screen title.keyboard statusis refused on iOS on both builds, so it measures resolution only.--udid--udidappstatesnapshot -ipresskeyboard statuskeyboard statuswith--udiddrops by about 290 ms. The other three were already within noise on main:appstatetakes the Apple-session path andsnapshot/pressdo not go throughresolveCommandDevice. The main and branch blocks ran sequentially, so compare within a block.No independent reviewer was available; I read the full diff cold.
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.