Skip to content

fix: preserve iOS AX snapshot failures#639

Merged
thymikee merged 1 commit into
mainfrom
fix/ios-ax-snapshot-failure
Jun 1, 2026
Merged

fix: preserve iOS AX snapshot failures#639
thymikee merged 1 commit into
mainfrom
fix/ios-ax-snapshot-failure

Conversation

@thymikee
Copy link
Copy Markdown
Member

@thymikee thymikee commented Jun 1, 2026

Summary

Preserve iOS XCTest accessibility snapshot serialization failures as typed IOS_AX_SNAPSHOT_FAILED errors instead of letting them look like runner transport failures.

Runner responses now carry a recovery hint through the Node client, so users get actionable guidance for scoped snapshots/direct selectors while the runner session remains usable for screenshot/logs/appstate.

Refs #637.

Touched files: 5. Scope stayed within iOS runner snapshot error handling and runner response parsing.

Validation

  • pnpm format
  • pnpm exec vitest run src/platforms/ios/__tests__/runner-client.test.ts
  • pnpm check:quick
  • pnpm build:xcuitest
  • Prototype simulator probe before removing the synthetic trigger confirmed the same runner session survived a typed AX snapshot failure and subsequent uptime succeeded.
  • Physical-device validation was blocked during investigation because Xcode reported the connected iPhones as offline.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Size Report

Metric Base Current Diff
JS raw 1.1 MB 1.1 MB +66 B
JS gzip 357.3 kB 357.4 kB +19 B
npm tarball 456.0 kB 456.9 kB +840 B
npm unpacked 1.5 MB 1.5 MB +3.4 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 25.3 ms 24.8 ms -0.5 ms
CLI --help 39.9 ms 39.5 ms -0.3 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/2415.js +66 B +19 B

@thymikee thymikee force-pushed the fix/ios-ax-snapshot-failure branch from 884d4b6 to 86da0f6 Compare June 1, 2026 12:47
@thymikee thymikee force-pushed the fix/ios-ax-snapshot-failure branch from 86da0f6 to d27d64e Compare June 1, 2026 12:55
@thymikee thymikee merged commit b09e7d3 into main Jun 1, 2026
18 checks passed
@thymikee thymikee deleted the fix/ios-ax-snapshot-failure branch June 1, 2026 13:10
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-01 13:11 UTC

thymikee added a commit that referenced this pull request Jun 1, 2026
… unsupported errors

Make RunnerSynthesizedGesture the single iOS multi-touch engine and drop the older
incompatible models:

- rotateGesture now drives the two-finger XCTest synthesis path (dx=dy=0, scale=1,
  degrees), mirroring the pinch migration in #634. The native XCUIElement.rotate(withVelocity:)
  injected a single synthetic rotation that React Native's rotation recognizer did not read
  reliably; synthesis fixes it. velocity is ignored on iOS (kept in the wire contract for
  compatibility; rotation direction comes from the sign of degrees).
- pinch is now synthesis on iOS and a clear UNSUPPORTED_OPERATION on tvOS/macOS. The macOS
  coordinate double-tap+drag heuristic (performCoordinatePinch) is removed: synthesis is
  iOS-only, so macOS multi-touch is reported honestly as unsupported rather than approximated.
- RunnerInteractionOutcome.unsupported now carries an actionable hint, mapped to ErrorPayload.hint
  (#639). Every unsupported gesture/tvOS path returns a concise message plus a next-step hint
  (existing messages kept verbatim).

Net: on iOS, pinch/rotate/transform all flow through one synthesis primitive. swipe/scroll/pan/
fling remain single-finger drags (correct, unchanged).

Coverage: examples/test-app/replays/gesture-lab.ad exercises pinch + rotate against the gesture
lab and asserts "pinch changed yes" / "rotate changed yes".
thymikee added a commit that referenced this pull request Jun 1, 2026
… unsupported errors (#645)

* fix(ios): unify multi-touch gestures on two-finger synthesis + hinted unsupported errors

Make RunnerSynthesizedGesture the single iOS multi-touch engine and drop the older
incompatible models:

- rotateGesture now drives the two-finger XCTest synthesis path (dx=dy=0, scale=1,
  degrees), mirroring the pinch migration in #634. The native XCUIElement.rotate(withVelocity:)
  injected a single synthetic rotation that React Native's rotation recognizer did not read
  reliably; synthesis fixes it. velocity is ignored on iOS (kept in the wire contract for
  compatibility; rotation direction comes from the sign of degrees).
- pinch is now synthesis on iOS and a clear UNSUPPORTED_OPERATION on tvOS/macOS. The macOS
  coordinate double-tap+drag heuristic (performCoordinatePinch) is removed: synthesis is
  iOS-only, so macOS multi-touch is reported honestly as unsupported rather than approximated.
- RunnerInteractionOutcome.unsupported now carries an actionable hint, mapped to ErrorPayload.hint
  (#639). Every unsupported gesture/tvOS path returns a concise message plus a next-step hint
  (existing messages kept verbatim).

Net: on iOS, pinch/rotate/transform all flow through one synthesis primitive. swipe/scroll/pan/
fling remain single-finger drags (correct, unchanged).

Coverage: examples/test-app/replays/gesture-lab.ad exercises pinch + rotate against the gesture
lab and asserts "pinch changed yes" / "rotate changed yes".

* fix(ios): fail-fast macOS pinch + align capability/docs with synthesis-only

Follow-through for removing the macOS coordinate pinch path (the runner now returns
UNSUPPORTED_OPERATION for macOS pinch): reject it at admission instead of round-tripping.

- capabilities.ts: pinch now matches rotate-gesture/transform-gesture (Android + iOS
  simulator only); macOS dropped. Removes the now-unused isMacOsOrMobileAppleSimulator helper.
- capabilities.test.ts: pinch expected unsupported on macOS and tvOS.
- website/docs/docs/commands.md: pinch listed for Android + iOS simulators only (removed from
  the macOS app-session list); documents that iOS rotate ignores the optional velocity arg
  (synthesis uses a fixed duration; direction comes from the sign of degrees).

Addresses PR #645 review HIGH #2 and MEDIUM #3.

* fix(ios): surface a hinted unsupported error for synthesis gestures at admission

Removing macOS pinch from the capability matrix makes macOS pinch (and the already-excluded
rotate-gesture/transform-gesture on macOS/tvOS/physical iOS) fail fast in ensureGenericCommandReady
before reaching the runner. That left the runner's macOS-specific hint unreachable on the daemon
path, so callers only saw the generic "<cmd> is not supported on this device".

Add an optional unsupportedHint to the capability matrix and surface it at admission, so the
synthesis-only gestures fail fast (no runner round-trip) AND return an actionable hint pointing to
where they work (Android + iOS simulator). Applied to pinch / rotate-gesture / transform-gesture.

Addresses PR #645 review (P2: route macOS pinch to the hinted failure).
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