MOB-99: honor the documented settle delay after iOS accessibility activation - #46
Merged
Merged
Conversation
…ivation MobDev.Connector.connect_all/1 has called IOS.enable_accessibility/1 for every iOS simulator target for a while, but never actually waited the ~500ms CLAUDE.md's own iOS accessibility activation section says to wait for the notifyutil broadcast to propagate before SwiftUI's accessibility tree is reliably ready. In practice wait_for_nodes's polling usually eats more than that anyway, but a caller driving taps the instant nodes connect had no guarantee. Companion fix in mob (ios/mob_nif.m) retry-hardens the point-based accessibility lookup itself as defense in depth for whatever residual race this doesn't fully close.
…not just iOS From code review on PR #46: Process.sleep(@ios_accessibility_settle_ms) was gated on platform == :ios alone, which also matches physical devices — IOS.enable_accessibility/1 shells out to `xcrun simctl spawn <udid> ...`, simulator-only tooling that's a no-op/error against a physical UDID. Every mix mob.connect against a physical iPhone paid the full 500ms tax for zero benefit. Now gated on the same platform == :ios && type == :simulator predicate kill_stale_simulator_apps/1 already uses for the identical reason. Not addressed (documented, not silently dropped): the fix is still a bare fixed-duration sleep, not a poll-until-ready check. A real readiness poll would need to run AFTER dist connects (there's no RPC path into the device yet at this point in connect_all/1), which is a bigger restructuring than this fix — flagging as a known limitation rather than attempting it here. Original PR description already disclosed this as "defense in depth for whatever residual race this doesn't fully close."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
MobDev.Connector.connect_all/1already calledIOS.enable_accessibility/1for every iOS simulator target, but never waited the ~500msCLAUDE.md's own iOS accessibility activation section says to wait for thenotifyutilbroadcast to propagate before SwiftUI's accessibility tree is reliably ready to query. In practicewait_for_nodes's polling usually eats more than that anyway, but a caller driving taps the instant nodes connect had no actual guarantee — the gap between "documented requirement" and "code that enforces it" was real.Companion PR (mob#84) retry-hardens the point-based accessibility lookup itself (
find_a11y_at_point) as defense in depth for whatever residual race this doesn't fully close — the two fixes address the same underlying mechanism from both ends.Test plan
mix test— 2117 passedmix format/mix credo --strict— cleanmix mob.connectpipeline against a fresh iOS simulator, thenMob.Test.frame/2+Mob.Test.tap_id/2called with zero artificial delay — succeeded, text field became first responderSee mob#84 for the full investigation writeup and an honest caveat about reproduction limits on the available hardware.
Linear: MOB-99 (companion PR: mob fix/mob-99-ios-native-view-hit-testing)
🤖 Generated with Claude Code