Skip to content

Migrate RCTAlertManager to handle synchronous void method execution (#56801)#56801

Open
christophpurrer wants to merge 1 commit into
facebook:mainfrom
christophpurrer:export-D104771644
Open

Migrate RCTAlertManager to handle synchronous void method execution (#56801)#56801
christophpurrer wants to merge 1 commit into
facebook:mainfrom
christophpurrer:export-D104771644

Conversation

@christophpurrer
Copy link
Copy Markdown
Contributor

@christophpurrer christophpurrer commented May 12, 2026

Summary:

In preparation for enabling enableSyncVoidMethods (D104331837), which makes TurboModule void methods execute synchronously on the JS thread instead of being dispatched asynchronously.

Currently, this module overrides methodQueue to return dispatch_get_main_queue() so its void methods execute on the main thread. When enableSyncVoidMethods is enabled, the methodQueue override is ignored for void methods — they execute directly on the JS thread. This causes crashes for any UI operations that must run on the main thread.

Fix: Remove the methodQueue override. The alertWithArgs method already dispatches UI work onto the main thread via RCTExecuteOnMainQueue, so it is already safe.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D104771644

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 12, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 12, 2026

@christophpurrer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104771644.

…acebook#56801)

Summary:

In preparation for enabling `enableSyncVoidMethods` (D104331837), which makes TurboModule void methods execute synchronously on the JS thread instead of being dispatched asynchronously.

Currently, this module overrides `methodQueue` to return `dispatch_get_main_queue()` so its void methods execute on the main thread. When `enableSyncVoidMethods` is enabled, the `methodQueue` override is ignored for void methods — they execute directly on the JS thread. This causes crashes for any UI operations that must run on the main thread.

**Fix:** Remove the `methodQueue` override. The `alertWithArgs` method already dispatches UI work onto the main thread via `RCTExecuteOnMainQueue`, so it is already safe.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D104771644
@meta-codesync meta-codesync Bot changed the title Migrate RCTAlertManager to handle synchronous void method execution Migrate RCTAlertManager to handle synchronous void method execution (#56801) May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant