-
Notifications
You must be signed in to change notification settings - Fork 74
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
Onyx connection can be called twice for the same data #569
Comments
I think I could build a failing unit test and fix the issue (cc @mountiny @marcaaron ) |
@hannojg yes please, feel free to investigate a fix for this |
PR is up here: |
@hannojg are you able to create the onyx bump now with the checklist filled in? thanks! |
Hey, yes I could, but I think you mentioned me in some other issue and someone else is doing the bump, no? |
Yeah that was after i commented here, i think they can handle that for you |
My first PR caused a few test to fail in the newdot code. I addressed the problems in these PRs (would appreciate a review): |
@hannojg I believe these changes are now live in the App, thank you! Do you reckon we can close this issue out? |
Yes, thats fixed now! |
There exists a "race condition" where an Onyx connection callback will be called twice for the same data. Potentially this can lead to unnecessary rerenders in the react applications.
The race condition happens when creating a connection and shortly after setting the data:
It once gets called here in
.set
:react-native-onyx/lib/Onyx.ts
Lines 274 to 275 in c53826b
and then here once the connection promise resolved:
react-native-onyx/lib/Onyx.ts
Line 175 in c53826b
The text was updated successfully, but these errors were encountered: