-
Notifications
You must be signed in to change notification settings - Fork 73
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: Onyx.update order #437
Fix: Onyx.update order #437
Conversation
113bbcd
to
ea2096d
Compare
… into @chrispader/fix-onyx-update-order
@neil-marcellini this PR should fix the problems with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really good, thank you! Would you please write manual test and link to the video showing it working for creating and deleting a workspace offline? That was great, so nice to see it finally working!
I do have a handful of comments and questions, and I would like to see some small changes to clean up a bit please.
@neil-marcellini the video showcasing the fix of the replay effect is under "Screenshots" |
Heading OOO for the holidays, so it might be best to assign another engineer if you want another review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my concerns, it makes sense now and looks good. This is awesome, and I think it's going to fix a lot of rare bugs we had lurking in the App!
@neil-marcellini
Details
Fixes a problem where
Onyx.update
seems to not apply updates in order. This was due to the merge queue not being cleared when we callOnyx.set
.Additionally, we returned early from
Onyx.set
andOnyx.merge
, when we removed keys from storage and therefore didn't "broadcast" the update and update subscribers.This PR fixed the problem with the order of
Onyx.update
by clearing the merge queue on everyOnyx.set
and additionally update subscribers with the cleared (null) value after removing a key intentionally withOnyx.set(SOME_KEY, null)
orOnyx.merge(SOME_KEY, null)
.This PR also fixes some inconsistencies with key removal in
Onyx.multiSet
andOnyx.multiMerge
.Related Issues
#266
Automated Tests
Added a Test "should apply updates in order with Onyx.update" in
onyxTest
, which testsOnyx.update
for applying the changes in the correct order.Manual Tests
Author Checklist
### Related Issues
section aboveTests
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2023-12-19.at.21.07.24.mp4
MacOS: Chrome / Safari
Screen.Recording.2023-12-19.at.20.58.50.mov
MacOS: Desktop
Added screen recordings for web and iOS web