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 |
neil-marcellini
left a comment
There was a problem hiding this comment.
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 |
neil-marcellini
left a comment
There was a problem hiding this comment.
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.updateseems 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.setandOnyx.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.updateby clearing the merge queue on everyOnyx.setand 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.multiSetandOnyx.multiMerge.Related Issues
#266
Automated Tests
Added a Test "should apply updates in order with Onyx.update" in
onyxTest, which testsOnyx.updatefor applying the changes in the correct order.Manual Tests
Author Checklist
### Related Issuessection aboveTestssectiontoggleReportand notonIconClick)myBool && <MyComponent />.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)Avataris modified, I verified thatAvataris working as expected in all cases)mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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