Copy odometer data during transaction merge - #86557
Conversation
… merge When merging two odometer distance expenses, the odometer readings (odometerStart, odometerEnd) and their images were not being transferred from the selected transaction. This caused the merged expense to show stale odometer data from the target transaction. The fix adds odometerStart/odometerEnd/odometerStartImage/odometerEndImage fields to the MergeTransaction type and propagates them through: - getMergeFieldUpdatedValues (copies from selected transaction) - buildMergedTransactionData (applies to merged display data) - mergeTransactionRequest API params (sends to backend) - getOnyxTargetTransactionData optimistic data (immediate UI update) Co-authored-by: Manan <mananjadhav@users.noreply.github.com>
Co-authored-by: Manan <mananjadhav@users.noreply.github.com>
|
Fixed the failing ESLint check: |
|
The failing checks have been fixed. The previous TypeScript error ( |
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.
|
|
@MelvinBot Please check the lint errors and the codecov has also decreased. |
|
All CI checks are currently passing on this PR, including:
There are no lint errors or codecov failures at this time. The issues you saw may have been from a previous commit that has since been resolved, or they may have been transient CI failures. If you're still seeing failures, could you share which specific check or error you're referring to? |
|
@rlinoz can you mark it ready for review. The code changes look fine. |
|
@mananjadhav 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] |
|
@codex review |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb Safari |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
🚧 @rlinoz 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! 🧪🧪
|
|
✋ 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/rlinoz in version: 9.3.59-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is a code-level bug fix that ensures odometer data ( I reviewed the two relevant help site articles:
Both articles remain accurate as-is. |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.3.59-4 🚀
|

Explanation of Change
When merging two odometer distance expenses, the odometer readings (
odometerStart,odometerEnd) and their images (odometerStartImage,odometerEndImage) were not being transferred from the selected transaction to the merged result. This caused the merged expense to display stale odometer data from the target transaction instead of the user's chosen values.The fix propagates odometer data through the entire merge pipeline:
MergeTransactiontype — AddedodometerStart,odometerEnd,odometerStartImage,odometerEndImagefields so the merge flow has storage for these values.getMergeFieldUpdatedValues— When themerchantfield is selected for an odometer distance request, copies the odometer readings and images from the selected transaction's comment.buildMergedTransactionData— Overrides the target transaction's odometer values in the comment with the merge transaction's values (when present).mergeTransactionRequest) — Includes odometer data in the comment JSON sent to the backend.getOnyxTargetTransactionData) — Includes odometer data in the optimistic Onyx update for immediate UI feedback.Fixed Issues
$ #82658
Tests
Offline tests
QA Steps
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari