Skip to content

fix race condition in IntentModule.mInitialURLListener#46499

Closed
sammy-SC wants to merge 1 commit into
facebook:mainfrom
sammy-SC:export-D62698183
Closed

fix race condition in IntentModule.mInitialURLListener#46499
sammy-SC wants to merge 1 commit into
facebook:mainfrom
sammy-SC:export-D62698183

Conversation

@sammy-SC
Copy link
Copy Markdown
Contributor

Summary:
changelog: [internal]

IntentModule.mInitialURLListener is accessed and mutated on three different threads and is missing synchronisation.

  1. In waitForActivityAndGetInitialURL it is accessed and mutated from thread mqt_v_native.

  2. In LifecycleEventListener it is mutated from the main thread.

  3. In invalidate it is read and mutated on a another thread.

Reviewed By: javache

Differential Revision: D62698183

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Sep 14, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D62698183

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D62698183

Summary:
Pull Request resolved: facebook#46499

changelog: [internal]

IntentModule.mInitialURLListener is accessed and mutated on three different threads and is missing synchronisation.

1. In [waitForActivityAndGetInitialURL](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java#L83) it is accessed and mutated from thread mqt_v_native.
2.  In [LifecycleEventListener](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java#L97) it is mutated from the main thread.

3. In [invalidate](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java#L44) it is read and mutated on a another thread.

Reviewed By: javache

Differential Revision: D62698183
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D62698183

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Sep 16, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in b63ec30.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @sammy-SC in b63ec30

When will my fix make it into a release? | How to file a pick request?

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 Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants