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

Register RCTDeviceInfo to invalidating and cleanup observer #42396

Closed
wants to merge 1 commit into from

Commits on Jan 24, 2024

  1. Register RCTDeviceInfo to invalidating and cleanup observer (facebook…

    …#42396)
    
    Summary:
    
    Cmmunity reported [facebook#42120](facebook#42120) where React Native was crashing if RCTDeviceInfo native module was receiving a notification while the bridge is invalidating.
    
    Upon investigation, I realized that:
    1. The RCTDeviceInfo module is never invalidated
    2. Observers are still observing even when the Bridge is in an invalidated state and it is not back up.
    
    This change makes sure that we invalidate the `RCTDeviceInfo.mm` module and that we unregister the observers.
    
    ## Changelog:
    [iOS][Fixed] - Make `RCTDeviceInfo` listen to invalidate events and unregister observers while invalidating the bridge
    
    Reviewed By: RSNara
    
    Differential Revision: D52912604
    cipolleschi authored and facebook-github-bot committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    9d15e1a View commit details
    Browse the repository at this point in the history