Closed hannojg closed 1 month ago
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
:https://github.com/Expensify/react-native-onyx/blob/c53826bbfe31e423fad0c33b0cb9ab097b88f128/lib/Onyx.ts#L274-L275
and then here once the connection promise resolved:
https://github.com/Expensify/react-native-onyx/blob/c53826bbfe31e423fad0c33b0cb9ab097b88f128/lib/Onyx.ts#L175