Repository navigation
fix(ios): respect devicectl minimum timeout for device probes - #3085
Conversation
- Clamp the CLI timeout to five seconds without extending the host deadline. - Cover short-budget tunnel lookups and timeout boundaries with regression tests.
|
Could a maintainer approve the fork workflows and review this for merging once the required checks pass? An independent agent review of Full CLI idle-gap behavior is still unverified. USB-first commands can bypass this CoreDevice path, so this PR only claims to correct the invalid timeout argument, not to resolve every runner failure. The validation limits are recorded in the description. |
|
Code-quality review (head 1. The devicectl floor is now a duplicated fact. Name it once (blocking)
/**
* The smallest `--timeout` devicectl accepts. ...
*/
export const IOS_HINGE_ANGLE_STREAM_SECONDS = 5;This PR adds a second, unnamed copy as the literal // config.ts
/** The smallest `--timeout` (seconds) devicectl accepts; smaller values exit 64 before any device query. */
export const IOS_DEVICECTL_MIN_TIMEOUT_SECONDS = 5;
/** The hinge-angle stream never ends on its own, so one read costs exactly the devicectl minimum ... */
export const IOS_HINGE_ANGLE_STREAM_SECONDS = IOS_DEVICECTL_MIN_TIMEOUT_SECONDS;// physical-device-coredevice.ts
const timeoutSeconds = Math.max(IOS_DEVICECTL_MIN_TIMEOUT_SECONDS, Math.ceil(timeoutMs / 1000));After this change, the constraint has one owner, and both devicectl 2. Below 5 s, the CLI
|
|
The probe change at 15343c4 is close, but one reuse issue needs a fix before merge. The devicectl minimum |
- Reuse one timeout floor for device details and hinge-angle probes. - Clarify host deadlines and retain the focused boundary regression cases.
|
Addressed in c2ed74a. Added IOS_DEVICECTL_MIN_TIMEOUT_SECONDS and reused it through both the details probe and hinge-angle stream constant. The xcdevice timeout sites are unchanged. Added the short host-deadline note and reduced the table to the five suggested boundary cases; the fake now reads the shared floor while expected CLI values remain literal. All runnable checks from pnpm check:affected --run passed on this head: 444 files / 3,210 tests. The focused suites passed 28 CoreDevice and 3 hinge-angle tests. Reinstating the old clamp still makes the shortened regression suite fail. The description now records the current validation and attributes the earlier live timings to their original commit. Coverage/native CI and full CLI idle-gap verification remain separate. |
|
The delta at c2ed74a fixes the issues from the earlier review (#3085 (comment)), and I have no new findings. The change stays inside packages/platform-apple/src/core: the probe clamp, one config constant and a unit test. CI shows 1 check with none failing. The fork matrix may not have run yet, so a maintainer needs to approve CI for the fork before merge. I did not run the tests or the pnpm check:affected gate, so the pass counts and the old-clamp mutation result in the PR are the author's own. I did not run devicectl live either. The exit 64 behavior below 5 s comes from the mocked error text in the test, and the clamp itself is a plain numeric floor. There are no conflicts. |
Summary
IOS_DEVICECTL_MIN_TIMEOUT_SECONDS, shared by details and hinge-angle probes. Leavexcdevicetimeouts unchanged.Validation
c2ed74a9ff3bf133d2872b7401bc854c2a7d8003.pnpm check:affected --run: all runnable gates passed, including 444 test files / 3,210 tests. Coverage and native CI lanes remain separate.15343c425, unchanged 1,000 ms budget: unpatched source returned no address twice (49/48 ms); patched source resolved it three times (641/456/498 ms). Not repeated for this constant-only refactor.