You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Merge - Receipt amount and distance does not match the amount and distance on confirm page #78567
Version Number: 9.2.88-5 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#78233 Email or phone of affected tester (no customers):sdonijsdoijsoijsio@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.1 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Go to self DM.
Create a Map distance expense.
Go to workspace chat.
Create a Map distance expense.
Go to Reports > Expenses.
Select both expenses via checkbox.
Click dropdown button > Merge.
Select the second merchant.
Select the first report.
Click Next.
On confirm page, open the receipt.
Expected Result:
Receipt amount and distance will match the amount and distance on confirm page.
Actual Result:
Receipt amount and distance does not match the amount and distance on confirm page.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
diff --git a/src/libs/MergeTransactionUtils.ts b/src/libs/MergeTransactionUtils.ts
index 561f922c72f..f3933bf3f40 100644
--- a/src/libs/MergeTransactionUtils.ts+++ b/src/libs/MergeTransactionUtils.ts@@ -79,9 +79,9 @@ function getMergeFieldErrorText(translate: LocaleContextProps['translate'], merg
* @param transaction - The transaction to update the receipt source for
* @returns The updated transaction with receipt.source filled if it was missing
*/
-function fillMissingReceiptSource(transaction: Transaction) {+function fillMissingReceiptSource(transaction: Transaction, force = false) {
// If receipt.source already exists, no need to modify
- if (!transaction.receipt || !!transaction.receipt.source || !transaction.receipt.filename) {+ if (!transaction.receipt || (!!transaction.receipt.source && !force) || !transaction.receipt.filename) {
return transaction;
}
@@ -549,14 +549,16 @@ function getMergeFieldUpdatedValues<K extends MergeFieldKey>(
updatedValues.reportName = reportName.length ? reportName : null;
}
- if (field === 'merchant' && isDistanceRequest(transaction)) {+ if (field === 'merchant' && isDistanceRequest(transaction) && transaction) {
const transactionDetails = getTransactionDetails(transaction);
updatedValues.amount = getMergeFieldValue(transactionDetails, transaction, 'amount') as number;
updatedValues.currency = getCurrency(transaction);
updatedValues.customUnit = transaction?.comment?.customUnit;
updatedValues.iouRequestType = transaction?.iouRequestType;
- // For manual distance requests, set waypoints/routes and receipt to null to clear any existing values- updatedValues.receipt = transaction?.receipt ?? null;+ // 1. For manual distance requests, set waypoints/routes and receipt to null to clear any existing values+ // 2. Distance requests from the Reports page have `receipt.source` set to an image filename, which is incorrect;+ // it should be a PDF filename. This ensures we always set `receipt.source` to the correct filename. https://github.com/Expensify/App/issues/78567+ updatedValues.receipt = fillMissingReceiptSource(transaction, true)?.receipt ?? null;
updatedValues.waypoints = getWaypoints(transaction) ?? null;
updatedValues.routes = transaction?.routes ?? null;
}
Activity
melvin-bot commentedon Dec 30, 2025
You have been assigned to this deploy blocker because you recently merged this PR: #78233
melvin-bot commentedon Dec 30, 2025
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Dec 30, 2025
Triggered auto assignment to @strepanier03 (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.github-actions commentedon Dec 30, 2025
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
hoangzinh commentedon Dec 30, 2025
@youssef-lr I found the root cause:
Reportspage, transactions havereceipt.sourceas an image (.jpg), instead of.pdfAttachmentViewto reach this line => and display the old eReceipt view.App/src/components/Attachments/AttachmentView/index.tsx
Line 265 in 4b4adcb
hoangzinh commentedon Dec 30, 2025
One solution I can think of is to force building the receipt resource when selecting the merchant here
App/src/libs/MergeTransactionUtils.ts
Line 552 in 4b4adcb
Click here to view diff
melvin-bot commentedon Dec 30, 2025
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
mountiny commentedon Dec 30, 2025
This is a new feature and minor edge case so demoting and @youssef-lr is handling it shortly
youssef-lr commentedon Jan 2, 2026
I retested this and it's fixed.