Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve sendIntent call, reject on exception thrown #50538

Closed
wants to merge 1 commit into from

Conversation

Abbondanzo
Copy link
Contributor

Summary:
Promises created from Linking.sendIntent calls never resolve, leaving them dangling. This change fixes the issue in two spots:

  1. By calling promise.resolve directly after the startActivity call
  2. By wrapping startActivity in a try/catch so any exceptions thrown are forwarded to the promise as a rejection

Changelog: [Android][Fixed] - Ensure Linking.sendIntent promises resolve or reject

Differential Revision: D72606918

@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 Apr 7, 2025
@facebook-github-bot
Copy link
Contributor

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

Abbondanzo added a commit to Abbondanzo/react-native that referenced this pull request Apr 8, 2025
Summary:

Promises created from `Linking.sendIntent` calls never resolve, leaving them dangling. This change fixes the issue in two spots:
1. By calling promise.resolve directly after the startActivity call
1. By wrapping startActivity in a try/catch so any exceptions thrown are forwarded to the promise as a rejection

Changelog: [Android][Fixed] - Ensure Linking.sendIntent promises resolve or reject

Reviewed By: NickGerleman

Differential Revision: D72606918
Summary:
Pull Request resolved: facebook#50538

Promises created from `Linking.sendIntent` calls never resolve, leaving them dangling. This change fixes the issue in two spots:
1. By calling promise.resolve directly after the startActivity call
1. By wrapping startActivity in a try/catch so any exceptions thrown are forwarded to the promise as a rejection

Changelog: [Android][Fixed] - Ensure Linking.sendIntent promises resolve or reject

Reviewed By: NickGerleman

Differential Revision: D72606918
@facebook-github-bot
Copy link
Contributor

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

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @Abbondanzo in 6609ba9

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

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Apr 8, 2025
@react-native-bot react-native-bot added the Merged This PR has been merged. label Apr 8, 2025
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 6609ba9.

@Abbondanzo Abbondanzo deleted the export-D72606918 branch April 8, 2025 15:59
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