Skip to content

Conversation

@sakhisheikh
Copy link
Contributor

@sakhisheikh sakhisheikh commented Jan 29, 2026

deviceInspectorMoveWithOptions is an async operation which navigates AX cursor in the specified direction and if the cursor moves to the desired element then we receive hostInspectorCurrentElementChanged: which is some case isn't invoked.
For example if on iPhone (e.g 16e) homescreen if we navigate to first element and if we try to navigate to first element again:

  • We send deviceInspectorMoveWithOptions to first element it works as expected we receive response callback as well
  • If we send deviceInspectorMoveWithOptions to first element again then AX inspecctor doesn't do anything because it doesn't find first element again if it's already on first element.
  • We will never receive hostInspectorCurrentElementChanged so code execution will be stuck forever. To circumvent this we initially decided to add a timeout but having this timeout leads to unintended issue with channels because in some scenarios response can also come after timeout and it becomes stale. The timeout was added with an assumption that response will never come back which doesn't hold true in case a consumer uses a shorter timeout (e.g 5ms).

So what's changing now:

  • we decouple "hostInspectorCurrentElementChanged" and a consumer can implement this to receiver new responses so Navigation/Move will never be blocked. a consumer can also implement it in a go routine to receive these new respones.

@sakhisheikh sakhisheikh changed the title [Draft] Decouple AX element response [Accessibility Inspector] Decouple AX element response callback Jan 30, 2026
@iSevenDays iSevenDays self-requested a review January 30, 2026 14:32
Copy link
Collaborator

@iSevenDays iSevenDays left a comment

Choose a reason for hiding this comment

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

LGTM

@iSevenDays iSevenDays merged commit 4e29a63 into danielpaulus:main Feb 2, 2026
3 checks passed
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.

2 participants