-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: pressability measureAsyncOnUI only running on Android cp-7.58.2 #22436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Android measure: Inconsistent error callbacks
The Android measure method returns early without invoking the callback when the view is not found or when rootView is null. This leaves the JavaScript callback waiting indefinitely, causing potential hangs. The iOS implementation correctly invokes the callback with an empty object in error cases, but Android doesn't match this behavior.
.yarn/patches/react-native-npm-0.76.9-1c25352097.patch#L460-L474
metamask-mobile/.yarn/patches/react-native-npm-0.76.9-1c25352097.patch
Lines 460 to 474 in 9b1b659
| +++ b/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h | |
| @@ -62,6 +62,10 @@ class SchedulerDelegate { | |
| bool isJSResponder, | |
| bool blockNativeResponder) = 0; | |
| + virtual void schedulerMeasureAsync( | |
| + const ShadowView& shadowView, | |
| + const std::function<void(folly::dynamic)>& callback) = 0; | |
| + | |
| virtual ~SchedulerDelegate() noexcept = default; | |
| }; | |
| diff --git a/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp b/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp | |
| index de07a2847b647bacb8130df901aa76818c831154..03eb507bbf62d87f10cf7baa10fd59a5b23987de 100644 | |
| --- a/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp |
Bug: Cross-Platform Measurement Inconsistency
The Android measure callback invokes with hardcoded 0, 0 as the first two parameters, while the iOS implementation returns frame.origin.x and frame.origin.y. This platform inconsistency means the same measurement API returns different values on Android versus iOS, breaking cross-platform compatibility.
.yarn/patches/react-native-npm-0.76.9-1c25352097.patch#L483-L484
metamask-mobile/.yarn/patches/react-native-npm-0.76.9-1c25352097.patch
Lines 483 to 484 in 9b1b659
| + runtime, | |
| + name, |
|



Description
#22323
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Uses
measureAsyncOnUIfor Android press interactions and wires new Fabric async measure APIs across JS, native (iOS/Android), and tests; updates RN to a Yarn patch.Libraries/Pressability/Pressability.js: UsemeasureAsyncOnUIonly on Android; keepmeasureon other platforms.measureAsyncOnUItoFabricUIManager(Libraries/ReactNative/FabricUIManager.js) and expose viaReactFabricHostComponent.UIManagerBinding.measureAsyncOnUIto call back into JS.Scheduler,SchedulerDelegate,UIManagerDelegate).RCTMountingManager.measureand route viaRCTSurfacePresenterto perform measurement on main thread.FabricUIManager.measureAsync,MountingManager.measure(with bounding box computation), and JNI plumbing (Binding,FabricMountingManager) to call into Java and invoke callbacks.jest/setup.js: MockmeasureAsyncOnUI.ReactNativeElement: AddmeasureAsyncOnUIdelegating tomeasure.package.json/yarn.lock: Pointreact-native@0.76.9to local Yarn patch.Written by Cursor Bugbot for commit 3df2f0f. This will update automatically on new commits. Configure here.