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

Skip invalidation of FabricUIManager on instance destroy #44122

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

janeli-100005636499545
Copy link
Contributor

Summary:
On Twilight app, we destroy the ReactInstanceManager in 2 different places: on login and on logout. The reason we decided to destroy ReactInstanceManager on login and logout is because we needed to reset the module parameters for our network requests so we could make them with the correct user identity when the user logs in and revoke the ability to make these requests when user logs out (see D37537716).

However, the call to FabricUIManager.invalidate() is problematic as it fails to properly clean up the surfaces on Twilight, causing the app to crash. Instead of destroying it, because the app is 95% ReactNative is defaulted to using the FabricUIManager by statically setting ReactFeatureFlags.enableFabricRenderer = true. This way, we still perform the clean up of the modules and re-create them on auth change, but we avoid the app crashing when it tries to destroy the UI manager.

Changelog: [Internal]

Differential Revision: D56208758

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 16, 2024
@facebook-github-bot
Copy link
Contributor

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

)

Summary:

On Twilight app, we destroy the ReactInstanceManager in 2 different places: on [login](https://www.internalfb.com/code/fbsource/[010a2797a2a5ec79140b616ea6e9c8296058bae2]/fbandroid/java/com/facebook/catalyst/shell/FbReactLoginActivity.java?lines=53) and on [logout](https://www.internalfb.com/code/fbsource/[010a2797a2a5ec79140b616ea6e9c8296058bae2]/fbandroid/java/com/oculus/twilight/crossapp/activity/XOCMainActivity.kt?lines=193). The reason we decided to destroy ReactInstanceManager on login and logout is because we needed to reset the module parameters for our network requests so we could make them with the correct user identity when the user logs in and revoke the ability to make these requests when user logs out (see D37537716).

However, the call to FabricUIManager.invalidate() is problematic as it fails to properly clean up the surfaces on Twilight, causing the app to crash. Instead of destroying it, because the app is 95% ReactNative is defaulted to using the FabricUIManager by statically setting ReactFeatureFlags.enableFabricRenderer = true. This way, we still perform the clean up of the modules and re-create them on auth change, but we avoid the app crashing when it tries to destroy the UI manager.

Changelog: [Internal]

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

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

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,387,940 -10
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,761,788 -9
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 8c53ac6
Branch: main

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 p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants