fix(ios): stop dump ui from timing out after 10s on heavy screens - #497
Cassian433 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe client now gives ChangesUI dump timeout handling
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The UI-dump timeout extension is wired through the client and server paths; no merge-blocking issue is supported by the reviewed evidence. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The 60s dump timeout from mobile-next#131 was lost when the agent moved to json-rpc in mobile-next#196.
2f69315 to
aece91f
Compare
On a big screen,
device.dump.uion iOS gives up after 10 seconds withRPC call device.dump.ui failed: Post "http://localhost:<port>/rpc": context deadline exceededwhile the agent is still building the snapshot. #448 hits it on a React Native SectionList, and a comment on mobile-mcp #470 reports the same failure under load.It's a regression. #131 gave the iOS dump 60s on purpose (the CHANGELOG still says so). When the agent moved to json-rpc in #196 (f41f841), GetSourceRaw and GetSourceElements in devices/devicekit/source.go started going through CallRPC, so a dump got the same 10s defaultRPCTimeout as a tap. Fixing only that isn't enough over HTTP: the server's WriteTimeout is also 10s and device.dump.ui wasn't in extendedWriteDeadline, so a slow dump would come back as an EOF instead.
What changed:
No device involved in testing. The new TestDumpUIWaitsForAnAgentSlowerThanTheDefaultRPCTimeout puts an httptest fake agent in front of the client that answers every call after 200ms: a plain CallRPC has to time out, both dump calls have to succeed. On main (only the const turned into a var so it compiles) it fails with the issue's error,
Post "http://127.0.0.1:43573/rpc": context deadline exceeded. On this branch it passes in 0.46s, and 20 runs in a row under -race were clean. I also ran a throwaway copy with the real timeouts and an agent that takes 11s: main gave up at 10.01s, the branch got the tree back at 11.01s. deadline_test.go lists device.dump.ui now.go test ./... -racepasses on Linux, most of its 20s is the daemon package.#470's home-screen hang on iOS 26.1 looks like its own agent problem, and this only moves that error from 10s to 55s. The intermittent dump failures after 10s in the comment there are this bug, though.
Closes #448
Summary by CodeRabbit