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

Commits on Apr 16, 2024

  1. Skip invalidation of FabricUIManager on instance destroy (facebook#44122

    )
    
    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
    janeli-100005636499545 authored and facebook-github-bot committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    1f458a9 View commit details
    Browse the repository at this point in the history