2 - Select attendee options when merging two expenses#71758
Conversation
This reverts commit bbebea5.
- Remove direct import of localeCompare from LocaleCompare module - Update getMergeableDataAndConflictFields to accept localeCompare as parameter - Update all React components to use localeCompare from useLocalize hook - Add localeCompare to useCallback dependency arrays where needed - Update tests to pass mock localeCompare function - Follows same pattern as PR Expensify#71430 for PolicyDistanceRatesPage This fixes the issue where localeCompare direct imports no longer work and ensures consistent usage of localization utilities across the app.
|
@dominictb 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] |
|
Our original PR was reverted here https://expensify.slack.com/archives/C01GTK53T8Q/p1759386483854869?thread_ts=1759370400.913469&cid=C01GTK53T8Q This PR is the 2nd attempt to support merge attendees. It also fixes LocalCompare issue and the optimistic report action issue |
|
@hoangzinh is this ready for review from @dominictb ? |
|
Yes, @garrettmknight. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariScreen.Recording.2025-09-28.at.22.55.21-compressed.movMacOS: Chrome / SafariScreen.Recording.2025-09-28.at.22.42.49-compressed.movMacOS: Desktop |
|
#71757 is still reproducible |
| const updatedReportAction = shouldBuildModifiedReportAction | ||
| ? buildOptimisticModifiedExpenseReportAction(transactionThread, transaction, transactionChanges, isFromExpenseReport, policy, updatedTransaction) | ||
| : undefined; | ||
| if (!hasPendingWaypoints && !(hasModifiedDistanceRate && isFetchingWaypointsFromServer(transaction)) && updatedReportAction) { |
There was a problem hiding this comment.
Is this to fix #71729? If so can you briefly explain the root cause and your solution? Also add a code comment like the "waypoints" cases above.
I also don't like the way we're using shouldBuildModifiedReportAction, can we check to stop building modified report action in-place like we're checking the waypoints here?
There was a problem hiding this comment.
The buildOptimisticModifiedExpenseReportAction will optimistically generate a system report action MODIFIED_EXPENSE like this

However, it seems in our merge flow, even when we select merchant/description from sourceTransaction, BE won't generate system report action MODIFIED_EXPENSE, thus it will cause the report not found, like this DB #71729. I think we should keep this OD behavior by not optimistically generating system report actions when merging expenses.
There was a problem hiding this comment.
Please update the param name to shouldBuildOptimisticModifiedExpenseReportAction; add param JSDoc comments above getUpdateTrackExpenseParams and getUpdateMoneyRequestParams functions; and update these comments saying that we don't do this for merged expense:
Lines 4148 to 4153 in aaed3a8
Lines 4585 to 4590 in aaed3a8
There was a problem hiding this comment.
There is a max-params linter after we add this new argument. I have refactored this function in this commit as well 650a200
…tendees merge logic - Update isEmptyMergeValue to return true for empty arrays - Update comment to reflect empty array handling - Improve attendees merge logic to use isEmptyMergeValue for better empty value detection - Add comprehensive test coverage for array handling in isEmptyMergeValue
I fixed in this commit 64f09fd by checking if attendee is empty |
…; return null instead of undefined for updatedReportAction; add comments noting no optimistic MODIFIED_EXPENSE for merged expenses; update MergeTransaction to pass false accordingly (per review suggestion)
…h inline destructuring - Create GetUpdateMoneyRequestParams type with all parameters - Update function signature to use single object parameter with inline destructuring - Update all 15+ function calls in IOU.ts to use object syntax - Update MergeTransaction.ts call to use object syntax - Simplify JSDoc to document single params object - Resolves ESLint max-params error (was 11 params, now 1 param) - More maintainable and self-documenting code
|
@hoangzinh we have conflicts |
|
@youssef-lr Conflicts are resolved |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.2.30-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.2.30-6 🚀
|
Explanation of Change
Fixed Issues
$ #68447
PROPOSAL:
Tests
Same as QA
Offline tests
Same as QA
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Precondition:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
Screen.Recording.2025-09-17.at.06.55.59.android.mov
Android: mWeb Chrome
Screen.Recording.2025-09-17.at.06.43.20.android.chrome.mov
iOS: Native
Screen.Recording.2025-09-17.at.07.11.43.mov
iOS: mWeb Safari
Screen.Recording.2025-09-17.at.07.07.41.mov
MacOS: Chrome / Safari
Screen.Recording.2025-09-17.at.06.00.02.web.mov
MacOS: Desktop
Screen.Recording.2025-09-17.at.07.00.16.desktop.mov