-
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(ios): potential race condition fix #3484
Merged
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
russellwheatley
requested review from
Salakar and
Ehesp
and removed request for
Ehesp and
Salakar
April 16, 2020 13:52
russellwheatley
changed the title
@russell/realtime db race condition
fix(database): potential race condition fix
Apr 16, 2020
Ehesp
reviewed
Apr 16, 2020
Codecov Report
@@ Coverage Diff @@
## master #3484 +/- ##
===========================================
+ Coverage 35.02% 56.68% +21.67%
===========================================
Files 26 108 +82
Lines 834 3432 +2598
Branches 194 0 -194
===========================================
+ Hits 292 1945 +1653
- Misses 408 1487 +1079
+ Partials 134 0 -134 |
…-native-firebase into @russell/realtime-db-bug
Salakar
changed the title
fix(database): potential race condition fix
fix(database,ios): potential race condition fix
May 6, 2020
Salakar
previously approved these changes
Jun 22, 2020
Salakar
reviewed
Jun 22, 2020
Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>
Salakar
approved these changes
Jun 22, 2020
Salakar
changed the title
fix(database,ios): potential race condition fix
fix(ios): potential race condition fix
Jun 22, 2020
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.
this may fix #2838. As noted in RN docs, the same dispatch queue instance has to be used: https://reactnative.dev/docs/native-modules-ios#threading
There's also some thread locking using the
@synchronized
directive courtesy of @Salakar. We're currently using theDISPATCH_QUEUE_SERIAL
macro which at the very least fixes this problem. In the future, we might be able to leverage the@synchronized
directive to make Realtime database calls concurrent using theDISPATCH_QUEUE_CONCURRENT
macro. This would help boost performance.However, this PR is aimed at the bugs stemming from issue #2838.
Summary
Checklist
Android
iOS
e2e
tests added or updated in packages/**/e2eTest Plan
Release Plan
[CATEGORY][type] [LOCATION] - Message
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter