Skip to content

fix(describe-ui): Retry when the simulator UI is not ready yet - #68

Open
BariBariGood wants to merge 2 commits into
cameroncooke:mainfrom
BariBariGood:fix/describe-ui-not-ready-retry
Open

fix(describe-ui): Retry when the simulator UI is not ready yet#68
BariBariGood wants to merge 2 commits into
cameroncooke:mainfrom
BariBariGood:fix/describe-ui-not-ready-retry

Conversation

@BariBariGood

Copy link
Copy Markdown

Summary

  • Querying the accessibility hierarchy within a few seconds of booting a simulator or launching an app can fail with "No translation object returned for simulator. This means you have likely specified a point onscreen that is invalid or invisible due to a fullscreen dialog" — even when no point was specified and the UI simply has not finished coming up. Retrying the same command a few seconds later succeeds, but the misleading message sends users debugging fullscreen dialogs that do not exist.
  • Detect this transient translation-unavailable error (including when it is nested in an underlying error) and retry with a short exponential backoff.
  • If the UI still is not ready after the retries, surface an accurate error explaining that the simulator UI is not ready for accessibility queries yet.
  • Adds an Unreleased changelog entry.

Validation

  • swift test passes (adds unit tests for the transient-error detection, including the nested-underlying-error case, and the retry/backoff logic).
  • Verified on an iPhone 17 / iOS 26.5 simulator: running describe-ui immediately after simctl boot, v1.8.0 fails instantly with the misleading message; with this change the same call either succeeds after the internal retries (~7s) or, if the UI takes longer, fails with the accurate "simulator UI is not ready" error.

Querying the accessibility hierarchy within a few seconds of booting a
simulator or launching an app can fail with:

    No translation object returned for simulator. This means you have
    likely specified a point onscreen that is invalid or invisible due
    to a fullscreen dialog

even when no point was specified and the UI simply has not finished
coming up. Retrying the same command a few seconds later succeeds.

Detect this transient translation-unavailable error (including when it
is nested in an underlying error), retry with a short exponential
backoff, and if the UI still is not ready after the retries, surface an
accurate error explaining that the simulator UI is not ready for
accessibility queries yet.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

AXe now retries accessibility queries when simulator translation data is unavailable. The retry logic checks chained error descriptions, applies increasing delays, and retries up to five times. After exhaustion, AXe throws a sanitised “UI is not ready yet” CLIError. Unrelated errors propagate immediately. Tests cover detection, retry timing, terminal errors, and unchanged propagation. The changelog documents the describe-ui behaviour.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: retrying describe-ui when the simulator UI is not ready.
Description check ✅ Passed The description directly explains the transient error, retry behaviour, final error, tests, changelog entry, and validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 12: Update the `describe-ui` changelog entry to append the originating
issue link `[`#458`](https://github.com/getsentry/XcodeBuildMCP/issues/458)` after
the existing description.

In `@Sources/AXe/Utilities/AccessibilityFetcher.swift`:
- Around line 51-56: Update retryingWhileTranslationUnavailable and the
point-query path in fetchAccessibilityInfoJSONData so a terminal translation
failure preserves or identifies the invalid/invisible point cause instead of
being replaced solely by the UI-readiness error. Keep frontmost queries’
existing behavior, and add coverage in AccessibilityFetcherTests for the
point-query terminal error path, including the relevant fixture condition.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ba5c5c2e-8bea-47ac-853e-729cf3cdf927

📥 Commits

Reviewing files that changed from the base of the PR and between 30f4bfa and b1c50b9.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • Sources/AXe/Utilities/AccessibilityFetcher.swift
  • Tests/AccessibilityFetcherTests.swift

Comment thread CHANGELOG.md Outdated
Comment thread Sources/AXe/Utilities/AccessibilityFetcher.swift Outdated
… exhausted

Point queries can exhaust translation retries on a permanent failure: the
simulator reports an invalid or dialog-hidden point with the same translation
error it uses for a UI that is not ready yet. The terminal error now keeps
both causes for point queries while frontmost queries keep their existing
message. Adds a test for the point-query terminal path and links the
originating getsentry/XcodeBuildMCP issue in the changelog.
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