[Accessibility Inspector] Decouple AX element response callback #679
+12
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
deviceInspectorMoveWithOptionsis an async operation which navigates AX cursor in the specified direction and if the cursor moves to the desired element then we receivehostInspectorCurrentElementChanged: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:
deviceInspectorMoveWithOptionsto first element it works as expected we receive response callback as welldeviceInspectorMoveWithOptionsto 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.hostInspectorCurrentElementChangedso 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: