Skip to content

A failed simctl list devicetypes read marks a foldable simulator non-foldable until the tool-server restarts #1532

Open

Description

@latekvo

[Diplomat, Opus 5.5]: isFoldableDeviceType (packages/tool-server/src/utils/ios-devices.ts:259-267) caches false for a device type whenever deviceTypeBundlePath returns nothing. That also happens when the listing failed: listDeviceTypeBundlePaths turns a timeout or error into an empty Map, the re-read-on-miss gets the same empty result, and false is memoized. The listing then writes false into foldableCache for every simulator of that type. Nothing re-checks once simctl recovers.

Impact: if the first listing after tool-server start runs while simctl list devicetypes hangs or fails, an iPhone Duo is never reported as foldable: true for the rest of the run. The foldable handling in simulator-server, screenshot-diff and screen recording also treats it as single-panel. This affects plain simulator rows on main, and, with #1490, provider-lent rows too.

Repro

I used an xcrun shim whose simctl list devicetypes --json hangs past its 10 s timeout until a marker file exists, and serves a Duo type with two integrated displays after that. The run called list-devices (an esbuild bundle of listDevicesTool) 3 times and created the marker after call 1.

  • Control, healthy from the start: call 1 has foldable: true on the Duo row.
  • Transient: call 1 took 20046 ms with no foldable. Calls 2 and 3 took 49 and 40 ms, still with no foldable. The shim log shows no further devicetypes call after call 1.

Found while reviewing #1490.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions