fix(ui-ios): pause UI mutations during touch scrolling - #8609
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
Included review availability: Your plan provides up to 8 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughAdds iOS touch-scroll mutation protection. Scroll delegates gate runtime pumps during dragging, deceleration, and two quiet cycles afterward. Tests cover overlapping scrolls, and a benchmark reproduces label updates and stack rebuilding during touch scrolling. ChangesiOS touch-scroll mutation handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This PR pauses UI mutations during touch scrolling to prevent concurrent UIKit layout failures, with focused tests and device validation included; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant User
participant UIScrollView
participant ScrollMutationGate
participant PerryPumpTarget
User->>UIScrollView: Drag or scroll the list
UIScrollView->>ScrollMutationGate: Begin or end scroll activity
PerryPumpTarget->>ScrollMutationGate: Check pump deferral
ScrollMutationGate-->>PerryPumpTarget: Defer during scrolling and quiet cycles
PerryPumpTarget-->>PerryPumpTarget: Skip runtime callbacks
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5af1936 to
6a09b2f
Compare
|
Merging as a validated pair on current
Ratchets re-run against the current baseline immediately before merge. These were staged alongside #8610, which is held: it adds +2 bare raw-handle reads in |
Summary
Prevent UIKit from laying out a scrolling
UIStackViewwhile Perry is concurrently applying JavaScript-driven label or arranged-subview mutations. The iOS runtime pump now stays quiescent for the full touch drag/deceleration and two pump turns after scrolling settles.Changes
UIScrollViewdelegate when each Perry scroll view is created, while preserving the existingonScrollEndbehavior.Related issue
Fixes #7763
Test plan
cargo fmt --all -- --checkcargo test -p perry-ui-ios --test scroll_mutation_gate(2 passed)cargo build --release -p perry-runtime-static -p perry-stdlib-static -p perry-ui-ios --target aarch64-apple-iosBASE_SHA=upstream/main SKIP_COMPILE_GATES=1 ./scripts/run_lint_gates.sh(all 53 script gates passed; compile tier covered by the focused iOS build above)Screenshots / output
Unpatched physical-device control aborted immediately after frame 600 with:
The patched device run passed frames 600 and 1200 without that exception, and the device produced no new
issue_7763_touch_scrollcrash report. A final install/launch smoke also succeeded after switching delegate ownership from a leak to an Objective-C association.I also built an XCUITest rapid-swipe harness, but iOS canceled UI-test initialization at the device-local authentication prompt (
LocalAuthentication Code=-2) before it sent any swipes, so that is not counted as a passing automated test.Checklist
feat:/fix:/docs:/chore:prefix convention.CONTRIBUTING.mdand agree to the Code of Conduct.Summary by CodeRabbit
Bug Fixes
Tests
Documentation