Skip to content

Conversation

@tommasini
Copy link
Contributor

@tommasini tommasini commented Nov 10, 2025

Description

#22323

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Uses measureAsyncOnUI for Android press interactions and wires new Fabric async measure APIs across JS, native (iOS/Android), and tests; updates RN to a Yarn patch.

  • Press interactions:
    • Libraries/Pressability/Pressability.js: Use measureAsyncOnUI only on Android; keep measure on other platforms.
  • Fabric measurement APIs:
    • JS/TS interfaces: Add measureAsyncOnUI to FabricUIManager (Libraries/ReactNative/FabricUIManager.js) and expose via ReactFabricHostComponent.
    • JS bridge: Implement UIManagerBinding.measureAsyncOnUI to call back into JS.
    • Scheduler/Delegates: Add async measure pathways (Scheduler, SchedulerDelegate, UIManagerDelegate).
  • iOS (Fabric):
    • Add RCTMountingManager.measure and route via RCTSurfacePresenter to perform measurement on main thread.
  • Android (Fabric):
    • Add FabricUIManager.measureAsync, MountingManager.measure (with bounding box computation), and JNI plumbing (Binding, FabricMountingManager) to call into Java and invoke callbacks.
  • Tests and RN DOM shim:
    • jest/setup.js: Mock measureAsyncOnUI.
    • ReactNativeElement: Add measureAsyncOnUI delegating to measure.
  • Build config:
    • package.json/yarn.lock: Point react-native@0.76.9 to local Yarn patch.

Written by Cursor Bugbot for commit 3df2f0f. This will update automatically on new commits. Configure here.

@tommasini tommasini requested a review from a team as a code owner November 10, 2025 19:39
@github-actions
Copy link
Contributor

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.

@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label Nov 10, 2025
@tommasini tommasini changed the title Fix/test ios crash final fix fix: pressability measureAsyncOnUI only running on Android Nov 10, 2025
@tommasini tommasini changed the title fix: pressability measureAsyncOnUI only running on Android fix: pressability measureAsyncOnUI only running on Android cp-7.58.2 Nov 10, 2025
weitingsun
weitingsun previously approved these changes Nov 10, 2025
Copy link

@cursor cursor bot left a 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

+++ 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

Fix in Cursor Fix in Web


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

Fix in Cursor Fix in Web


@sonarqubecloud
Copy link

@tommasini tommasini enabled auto-merge November 11, 2025 00:15
@tommasini tommasini added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Nov 11, 2025
@tommasini tommasini added this pull request to the merge queue Nov 11, 2025
Merged via the queue into main with commit 7e3f4ce Nov 11, 2025
155 of 159 checks passed
@tommasini tommasini deleted the fix/test-ios-crash-final-fix branch November 11, 2025 00:54
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-S team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants