Skip to content

Conversation

@RSNara
Copy link
Contributor

@RSNara RSNara commented Jun 14, 2024

Summary:
If a react instance create fails, ReactHost calls handleHostException. This method uses the dev support manager to show the redbox: line 789.

https://www.internalfb.com/code/fbsource/[bf94dae8c8b7527653145fdd799f6f47b1f8b284]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java?lines=784-793

But, if react instance reload fails, react host does everything in handleHostException, except call into dev support manager to show the redbox.

https://www.internalfb.com/code/fbsource/[bf94dae8c8b7527653145fdd799f6f47b1f8b284]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java?lines=457-466

Hence, the redbox doesn't show.

Thoughts

These two code-paths do really similar things. I'm thinking about how to unify them.

Differential Revision: D58592928

@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 Jun 14, 2024
@facebook-github-bot
Copy link
Contributor

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

@analysis-bot
Copy link

analysis-bot commented Jun 14, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 20,365,763 +208
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 23,569,729 +115
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 2b640be
Branch: main

Summary:
Pull Request resolved: facebook#44959

If a react instance create fails, ReactHost [calls handleHostException](https://www.internalfb.com/code/fbsource/[bf94dae8c8b7527653145fdd799f6f47b1f8b284]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java?lines=784-793%2C956-959%2C966%2C979-980%2C982%2C985-986). This method uses the dev support manager to show the redbox: line 789.

https://www.internalfb.com/code/fbsource/[bf94dae8c8b7527653145fdd799f6f47b1f8b284]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java?lines=784-793

But, if react instance reload fails, react host does everything in handleHostException, **except** call into dev support manager to show the redbox.

https://www.internalfb.com/code/fbsource/[bf94dae8c8b7527653145fdd799f6f47b1f8b284]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java?lines=457-466

Hence, the redbox doesn't show.

## Thoughts
These two code-paths do really similar things. I'm thinking about how to unify them.

Changelog: [Android][Fixed] Show RedBox after reloads fail (bridgeless)

Reviewed By: alanleedev

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

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

@RSNara RSNara force-pushed the export-D58592928 branch from 1bd23b7 to 4c5c160 Compare June 14, 2024 21:50
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 14, 2024
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 2f8d4f0.

@github-actions
Copy link

This pull request was successfully merged by @RSNara in 2f8d4f0.

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