Repository navigation
fix(mobilerun): keep a failed state snapshot from answering 404 - #38
Merged
Timo972 merged 1 commit intoOct 2, 2026
Conversation
GET /mobilerun/state let a failed application snapshot fall through to the global exception mapping, which answers FBStaleElementException with 404. That is also what a stock WebDriverAgent answers for the missing route, so mobilerun-ios latched "no /mobilerun/state on this runner" and served every later /state from the /source dump: 5+ s (12+ s on SpringBoard), and with the display name or nothing as packageName, since the source root carries no bundle ID. The snapshot fails right after a Home press, when the app resolved at the start of the request is the one leaving the foreground. Retry once with the active app resolved anew, and if that fails too answer 400 (invalid element state): neither the route-missing 404 nor a wedged-runner 5xx. Refs DRO-3213 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
niko-droidrun
approved these changes
Oct 1, 2026
Timo972
deleted the
timo/dro-3213-ios-portal-state-slow-and-missingincorrect-packagename-after
branch
October 8, 2026 09:32
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.
Refs DRO-3213. Companion client fix: droidrun/mobilerun-ios#202
Problem
GET /mobilerun/statelet a failed application snapshot fall through to the global exception mapping, which answersFBStaleElementExceptionwith 404. A stock WebDriverAgent answers a missing route with 404 too, so mobilerun-ios decided "this runner has no/mobilerun/state" and served every later/statefrom the/sourcedump. That took 5+ s (12+ s on SpringBoard), andpackageNamebecame the display name or nothing, since the source root carries no bundle ID.The snapshot fails right after a Home press, when the app resolved at the start of the request is the one leaving the foreground.
Fix
invalid element state). That's neither the route-missing 404 nor a 5xx, which mobilerun-ios reads as a wedged runner and relaunches for (the DRO-3178 concern).The retry-and-map logic is a class method (
+stateWithSnapshotAttempt:failure:), so it can be unit-tested without XCUI.Tests
FBMobilerunA11yCommandsTests: it failed against the old behavior (exception propagated, no retry) and passes now.UnitTestssuite passes (253 tests, 1 skipped) on the iPhone 17 Pro simulator.WebDriverAgentLib_tvOSbuilds.🤖 Generated with Claude Code