Expense - Duplicate not resolve when admin "Keep this one" for duplicated expenses on 2 reports#84476
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@QichenZhu Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e1fdebf53
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
src/libs/actions/IOU/Duplicate.ts
Outdated
| transactionID: params.transactionID, | ||
| reportActionIDList, | ||
| transactionIDList: orderedTransactionIDList, | ||
| transactionIDList: params.transactionIDList, |
There was a problem hiding this comment.
Keep transaction and action lists aligned in resolve payload
When the new loop skips a duplicate because transaction or iouAction is missing (e.g., the other report’s actions are not loaded in Onyx yet), reportActionIDList omits that entry but transactionIDList still sends the full params.transactionIDList. ResolveDuplicatesParams expects these arrays to correspond by index, so this can produce a malformed request where holds are applied to the wrong transaction or the API rejects the command. Build transactionIDList from the same successful matches used to populate reportActionIDList.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I think this comment is correct, no?
There was a problem hiding this comment.
Yeah I think so.
App/src/libs/API/parameters/ResolveDuplicatesParams.ts
Lines 5 to 6 in 1bb1b9e
App/src/libs/API/parameters/ResolveDuplicatesParams.ts
Lines 20 to 21 in 1bb1b9e
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-09.at.7.40.43.PM.movAndroid: mWeb ChromeScreen.Recording.2026-03-09.at.7.43.42.PM.moviOS: HybridAppSimulator.Screen.Recording.-.iPhone.17.-.2026-03-09.at.19.02.38.moviOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.17.-.2026-03-09.at.19.05.25.movMacOS: Chrome / SafariScreen.Recording.2026-03-09.at.7.47.07.PM.mov |
QichenZhu
left a comment
There was a problem hiding this comment.
Changes LGTM.
This scenario is worth unit testing. Could you add some?
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Makes sense for product
|
Thanks! The unit test passes with the fix and fails without it, so it does its job even though coverage decreases. |
|
🚧 @iwiznia has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 9.3.41-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.41-4 🚀
|
Explanation of Change
Fixed Issues
$ #82568
PROPOSAL: #82568 (comment)
Tests
Precondition: Employee create and submit two similar manual expenses on two different reports to workspace chat
Offline tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.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.mov
Android: mWeb Chrome
website.android.mov
iOS: Native
ios.mov
iOS: mWeb Safari
website.ios.mov
MacOS: Chrome / Safari
website.mov