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

Conversation

cipolleschi
Copy link
Contributor

Summary:
Cmmunity reported #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

Differential Revision: D52912604

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

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Jan 22, 2024
…#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

Differential Revision: D52912604
cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Jan 22, 2024
…#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

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

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

1 similar comment
@facebook-github-bot
Copy link
Contributor

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Jan 23, 2024
…#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

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

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Jan 23, 2024
…#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
@facebook-github-bot
Copy link
Contributor

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Jan 23, 2024
…#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
@facebook-github-bot
Copy link
Contributor

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Jan 23, 2024
…#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
@facebook-github-bot
Copy link
Contributor

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Jan 23, 2024
…#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
@facebook-github-bot
Copy link
Contributor

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Jan 23, 2024
…#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
@facebook-github-bot
Copy link
Contributor

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Jan 24, 2024
…#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
@facebook-github-bot
Copy link
Contributor

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Jan 24, 2024
…#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
@facebook-github-bot
Copy link
Contributor

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Jan 24, 2024
…#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
@facebook-github-bot
Copy link
Contributor

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

…#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
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jan 24, 2024
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in d46d80d.

blakef pushed a commit that referenced this pull request Jan 25, 2024
Summary:
Pull Request resolved: #42396

Cmmunity reported [#42120](#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

fbshipit-source-id: 1727bcdef5393b1bd5a272e2143bc65456c2a389
facebook-github-bot pushed a commit that referenced this pull request Apr 4, 2024
…o module (#43737)

Summary:
Previous fix brings in #42396. Seems it's a mistake to re-add observer?
So let's remove it and also not `invalidate` method not be called twice.

## Changelog:

[IOS] [FIXED] - Remove invalidate observer instead of re-adding observer in DeviceInfo module

Pull Request resolved: #43737

Test Plan: Fix for #42120 also works.

Reviewed By: javache

Differential Revision: D55692219

Pulled By: cipolleschi

fbshipit-source-id: dba1ddc39a9f2611fc2b84fadf8c23827891379a
cortinico pushed a commit that referenced this pull request Apr 8, 2024
…o module (#43737)

Summary:
Previous fix brings in #42396. Seems it's a mistake to re-add observer?
So let's remove it and also not `invalidate` method not be called twice.

## Changelog:

[IOS] [FIXED] - Remove invalidate observer instead of re-adding observer in DeviceInfo module

Pull Request resolved: #43737

Test Plan: Fix for #42120 also works.

Reviewed By: javache

Differential Revision: D55692219

Pulled By: cipolleschi

fbshipit-source-id: dba1ddc39a9f2611fc2b84fadf8c23827891379a
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.

None yet

2 participants