-
Notifications
You must be signed in to change notification settings - Fork 89
Implemented partialSetCollection #677
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
Implemented partialSetCollection #677
Conversation
|
@shubham1206agra is this implementation directly coming from the design doc, or is there any linked conversation which I can follow? |
|
@parasharrajat We discussed about this here https://expensify.slack.com/archives/C08CZDJFJ77/p1755275332300729 |
|
Hi, what's the status of this PR and what are the next steps? |
|
@parasharrajat You can start the testing now. Just test for any anomalies in the App. |
|
@shubham1206agra There is a conflict in Onyx that will probably effect this PR that you want to fix before having it tested. |
|
@tgolen Done |
|
Thanks! @parasharrajat you can start testing whenever you are ready then! |
|
Sure, |
| // Confirm all the collection keys belong to the same parent | ||
| if (!doAllCollectionItemsBelongToSameParent(collectionKey, resultCollectionKeys)) { | ||
| Logger.logAlert(`setCollection called with keys that do not belong to the same parent ${collectionKey}. Skipping this update.`); | ||
| return Promise.resolve(); |
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.
Maybe we should reject this and throw an error back. This is a development mistake, so they should not proceed with such code. Silencing this error could give false positive.
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.
This is the standard implementation across different methods. We are logging an alert. If we throw an error here, it will cause issues (crash) if we get some bad updates from BE.
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.
Ok. Talking about backend updates where are we handling the backend updates for this new method.
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.
@shubham1206agra Are we handling backend updates for this somewhere or it is not required?
Line 516 in 6978c02
| function update(data: OnyxUpdate[]): Promise<void> { |
| afterEach(() => { | ||
| Onyx.clear(); | ||
| }); | ||
| it('should replace all existing collection members with new values and keep old ones intact', async () => { |
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.
This tests does not to match with function description.
Any existing collection members not included in the new data will not be removed
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.
What do you think should happen here?
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.
Oops, I just saw that "not be removed".
|
@shubham1206agra Do you have some issue to link to this PR? |
|
Going to test this PR against NewDot... |
|
@parasharrajat How is the testing going? |
|
I will have next update today. |
|
Ok, I tested with rules changes to workspaces triggering violations, name changes to workspaces, deleting multiple transactions, etc. And I didn't find any issue with this PR. |
|
@carlosmiceli do you want to review this and then merge it? |
|
There is no parent issue linked. @tgolen can you create a payment task for me on this task for PR review? |
|
OK, I created Expensify/App#71844 to handle payments. |
Details
Implemented
partialSetCollectionso that update uses this for collection keys to eliminate extra notify calls.Related Issues
#313
Automated Tests
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
MacOS: Chrome / Safari
MacOS: Desktop