Skip to content

Commit 0ff4c85

Browse files
christophpurrermeta-codesync[bot]
authored andcommitted
Migrate RCTAlertManager to handle synchronous void method execution (#56801)
Summary: Pull Request resolved: #56801 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 fbshipit-source-id: 4f1eae55c64e56990efc20c4b32af1d722520037
1 parent e4cb767 commit 0ff4c85

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

packages/react-native/React/CoreModules/RCTAlertManager.mm

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ @implementation RCTAlertManager {
4242

4343
RCT_EXPORT_MODULE()
4444

45-
- (dispatch_queue_t)methodQueue
46-
{
47-
return dispatch_get_main_queue();
48-
}
49-
5045
- (void)invalidate
5146
{
5247
RCTExecuteOnMainQueue(^{

0 commit comments

Comments
 (0)