-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
fix(emulator): protect against double useEmulator calls natively #6615
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guards against case where hot-reload of javascript means state is lost and second native calls are attempted (and rejected...) Fixes #5650
In case of javascript hot reload, javascript will attempt to call useEmulator again, and the native layer will complain about the second call. This avoids the second call by tracking useEmulator call state at the native layer Fixes #5860 (again, but this time per-app, and for android as well)
covers case where javascript hot-reloads and loses state then calls again by tracking state of calls natively Fixes #5723
in case javascript hot reloads, track useEmulator calls natively and drop calls after the first one
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Codecov Report
@@ Coverage Diff @@
## main #6615 +/- ##
=============================================
+ Coverage 54.53% 72.30% +17.78%
=============================================
Files 209 110 -99
Lines 10399 4678 -5721
Branches 1650 1051 -599
=============================================
- Hits 5670 3382 -2288
+ Misses 4445 1216 -3229
+ Partials 284 80 -204 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Most of the useEmulator calls (except functions?) are "call once only" with the native SDKs throwing errors or otherwise being upset by second calls
However, javascript bundles hot-reload so they cannot determine if they have already called useEmulator or not
Related issues
Noted in the specific commits targeted
Fixes #5860
Fixes #5650
Fixes #5723
Release Summary
a bunch of
fix
conventional commitsChecklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter