From 774f033e8cbbd7b922b6378c1e6f87d894e63969 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Tue, 12 May 2026 17:33:49 -0700 Subject: [PATCH] Migrate RCTAlertManager to handle synchronous void method execution (#56801) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- packages/react-native/React/CoreModules/RCTAlertManager.mm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/react-native/React/CoreModules/RCTAlertManager.mm b/packages/react-native/React/CoreModules/RCTAlertManager.mm index 2b9fc60c9681..8dbe57b90ba3 100644 --- a/packages/react-native/React/CoreModules/RCTAlertManager.mm +++ b/packages/react-native/React/CoreModules/RCTAlertManager.mm @@ -42,11 +42,6 @@ @implementation RCTAlertManager { RCT_EXPORT_MODULE() -- (dispatch_queue_t)methodQueue -{ - return dispatch_get_main_queue(); -} - - (void)invalidate { RCTExecuteOnMainQueue(^{