Repository navigation
[Hold for payment 2024-07-31] [Dupe Detection] Merge Duplicates - Confirm Page #39810
Description
Part of the Merge Duplicates project
Main issue: https://github.com/Expensify/Expensify/issues/307591
Doc section: Surfacing Potential Duplicates
Project: [Wave: Collect Approvers] Dupe Detection
Part of a series of issues:
- [HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] [Dupe Detection] Merge Duplicates - Review Page #39756
- [HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [Dupe Detection] Merge Duplicates - Review Fields Page #39808
- [Hold for payment 2024-07-31] [Dupe Detection] Merge Duplicates - Confirm Page #39810
Feature Description
Context for ReviewDuplicates
- Review page - /r/:threadReportID/duplicates/review
- Merchant - /r/:threadReportID/duplicates/review/merchant
- Category - /r/:threadReportID/duplicates/review/category
- Tag - /r/:threadReportID/duplicates/review/tag
- Description - /r/:threadReportID/duplicates/review/description
- Confirm page - /r/:threadReportID/duplicates/confirm
All of these screens will exist in their own navigator so they can be pushed (and later popped off once complete) as a group.
All of this will use an Onyx form key of ONYXKEYS.FORMS.REVIEW_DUPLICATES_FORM so we can store the data selected by the user so far when resolving the duplicates. It also lets us keep track of which transaction to keep and which ones are duplicates when the user clicks on Keep this one.
This key will follow a structure like this:
{
"review_duplicates_form_<transactionID>": [
{
"duplicates": {
<transactionID>: <transactionID>,
...
},
"merchant": "...",
"tag": ...",
"description": ...",
…
}
]
}
Confirm Page
Our last confirm page will show a similar non-editable version of MoneyRequestView:
- Enable shouldShowOfflineIndicator for the screenwrapper as the command only works online.
- This view is also a form component but features a green “Confirm” button.
- onPress, we call an action in actions/IOU.js called mergeDuplicates which calls:
API.write('MergeDuplicates',
{
transactionID, // transaction to keep
transactionIDs, // transactions to delete
created,
merchant,
...
}:
Some notes about the above request:
-
Since we are using pattern B, we need to set the optimistic and failure data. When we merge two or more transactions, we basically need to get rid of the ones that we don’t want to keep and update the one that we want to keep.
- Removing the ones that we don’t want to keep works similarly to when we delete a money request, so we will update Onyx data really similarly to what we do here.
- Additionally, we need to update the
transactions_key in Onyx with the updated fields (merchant, tags, category…) for the transactionID. - We also need to update the comment in the
transactions_key in Onyx to remove the duplicate violation violation within the comment. - We also need to update the
transactionViolations_key in Onyx to remove the duplicate violation. We’ll update theViolationUtils.getViolationsOnyxDatamethod that calculates the new transaction violations (by adding/removing those that have been addressed with the current user changes), and returns an object that we can save into Onyx, to work with duplicate violations as well.
-
We will navigate the user directly back to the MoneyRequestView of the expenseReport we were keeping.
Issue Owner
Current Issue Owner: @kubabutkiewiczMetadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone

Activity
melvin-bot commentedon Apr 8, 2024
Triggered auto assignment to @sakluger (
NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details.pecanoro commentedon Apr 17, 2024
Callstack will be taking this series of tasks
[-][HOLD][Dupe Detection] Merge Duplicates - Confirm Page[/-][+][Dupe Detection] Merge Duplicates - Confirm Page[/+]kubabutkiewicz commentedon Apr 22, 2024
Hi, I'm Jakub from Callstack - expert contributor group - and I would like to take a look at this issue.
27 remaining items
trjExpensify commentedon Jul 26, 2024
Did the automation not run here? Seems like it hit prod 3 days ago: #42571 (comment)
pecanoro commentedon Jul 26, 2024
Hmm, yes, I think it failed
[-][Dupe Detection] Merge Duplicates - Confirm Page[/-][+][Hold for payment 2024-07-31] [Dupe Detection] Merge Duplicates - Confirm Page[/+]JmillsExpensify commentedon Jul 30, 2024
cc @sakluger this is ready for payment soon.
sakluger commentedon Aug 9, 2024
Sorry, everyone, I just noticed that this issue slipped through the cracks.
Summarizing payment on this issue:
Contributor: @kubabutkiewicz $250 - contractor, no payment required
Contributor+: @parasharrajat $250, please request on Newdot
@parasharrajat do we need any regression tests for this one? Maybe something similar to the tests laid out in the PR?
parasharrajat commentedon Aug 9, 2024
Regression Test Steps
Do you agree 👍 or 👎 ?
sakluger commentedon Aug 12, 2024
Thanks! Those steps are pretty good, I edited them to be a bit more specific.
parasharrajat commentedon Aug 30, 2024
Payment requested as per #39810 (comment)
JmillsExpensify commentedon Sep 2, 2024
$250 approved for @parasharrajat