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
[$250] Expense - Inconsistent expense type shown during scan – “Receipt” in chat, “Cash” in IOU report #82591
Version Number: V9.3.20-2 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#80003 Email or phone of affected tester (no customers):dreamnitethedragon+msiw@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Redminote 10S Android 13 App Component: Money Requests
Action Performed:
Launch app
Open 1:1 chat
Create 2 scan expense with camera image
While scanning note the preview in 1:1 chat and IOU report page
Expected Result:
While expense is scanning, 1:1 chat preview must show "cash" in preview in all sections.
Actual Result:
While expense is scanning, 1:1 chat preview shows "Receipt" but in IOU report page "cash" is shown.
Please re-state the problem that we are trying to solve in this issue.
Expense - Inconsistent expense type shown during scan – “Receipt” in chat, “Cash” in IOU report
What is the root cause of that problem?
There is a mismatch in getTransactionPreviewTextAndTranslationPaths: for scanning transactions it overrides the already-derived expense type label and forces common.receipt.
Root cause:
What changes do you think we should make in order to solve the problem?
Keep the expense type derived from getExpenseTypeTranslationKey(getTransactionType(transaction)) even when the transaction is scanning, instead of replacing it with receipt.
Please re-state the problem that we are trying to solve in this issue.
When a scan expense is being processed, the 1:1 chat preview shows "Receipt" while the IOU report page shows "Cash" for the same transaction. The expense type label should be consistent across both views.
What is the root cause of that problem?
Two different code paths render the expense type label with different scanning-state handling:
Chat preview path (src/libs/TransactionPreviewUtils.ts:302-309): The function getTransactionPreviewTextAndTranslationPaths correctly initializes previewHeaderText using getExpenseTypeTranslationKey(getTransactionType(transaction)) (which resolves to 'iou.cash' = "Cash" for a scanned receipt). However, at line 308-309, when isTransactionScanning is true, it overrides this to 'common.receipt' = "Receipt":
// Line 302 - correct defaultletpreviewHeaderText=[{translationPath: getExpenseTypeTranslationKey(getTransactionType(transaction))}];// Lines 304-309 - scanning override replaces 'Cash' with 'Receipt'if(isDistanceRequest(transaction)){
...
}elseif(isTransactionScanning){previewHeaderText=[{translationPath: 'common.receipt'}];// BUG}
IOU report table path (src/components/TransactionItemRow/DataCells/TypeCell.tsx:42-45): TypeCell calls getExpenseTypeTranslationKey(getTransactionType(transaction)) directly with no scanning override, so it correctly shows "Cash".
The getTransactionType function (src/libs/TransactionUtils/index.ts:337-364) classifies a scanned receipt (no card, not distance) as CASH, and getExpenseTypeTranslationKey maps that to 'iou.cash' = "Cash". The scanning override in TransactionPreviewUtils.ts is the sole cause of the inconsistency.
What changes do you think we should make in order to solve the problem?
In src/libs/TransactionPreviewUtils.ts, update the scanning branch (line 309) to preserve the actual expense type instead of hardcoding 'common.receipt':
Change the scanning branch from using 'common.receipt' to using getExpenseTypeTranslationKey(getTransactionType(transaction)), with 'common.receipt' as a fallback. This ensures the chat preview label matches the IOU report page for all expense types (Cash, Card, etc.) during scanning.
What alternative solutions did you explore? (Optional)
Alternative: Remove the scanning branch entirely. Since line 302 already initializes previewHeaderText with the correct expense type, the isTransactionScanning branch could be removed so it falls through to the default. This also works but is slightly less explicit about the scanning case.
Note:MoneyRequestReportPreviewContent.tsx:371 also hardcodes 'common.receipt' for scanning transactions in multi-expense report previews. That may warrant a similar fix but is a separate concern from the 1:1 chat preview inconsistency reported here.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
📣 @Eskalifer1 You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖
It seems we don’t plan to fix this bug (#85410 (comment)). Let's handle payment here; the PR has been created and approved with a C+, so it looks like 100% compensation.
Oh my goodness @mkhutornyi I'm so sorry. For some reason I thought I checked and saw the C+ was from one of our agencies which is why I didn't include you. I must have messed it up with another GH I was processing at the same time.
Payment summary:
@mkhutornyi please request $250 payment via NewDot.
Activity
Eskalifer1 commentedon Feb 16, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense - Inconsistent expense type shown during scan – “Receipt” in chat, “Cash” in IOU report
What is the root cause of that problem?
There is a mismatch in
getTransactionPreviewTextAndTranslationPaths: for scanning transactions it overrides the already-derived expense type label and forcescommon.receipt.Root cause:
App/src/libs/TransactionPreviewUtils.ts
Lines 289 to 297 in b14d99a
What changes do you think we should make in order to solve the problem?
Keep the expense type derived from
getExpenseTypeTranslationKey(getTransactionType(transaction))even when the transaction is scanning, instead of replacing it withreceipt.Code to update:
App/src/libs/TransactionPreviewUtils.ts
Lines 295 to 297 in b14d99a
What alternative solutions did you explore? (Optional)
Remove the
isTransactionScanningoverride block entirely sopreviewHeaderTextalways uses the default initialization from line 289.This also fixes the issue, but is slightly less explicit than keeping the scanning branch and setting the same expense-type translation directly.
melvin-bot commentedon Mar 5, 2026
Triggered auto assignment to @heyjennahay (
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.MelvinBot commentedon Mar 5, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a scan expense is being processed, the 1:1 chat preview shows "Receipt" while the IOU report page shows "Cash" for the same transaction. The expense type label should be consistent across both views.
What is the root cause of that problem?
Two different code paths render the expense type label with different scanning-state handling:
Chat preview path (
src/libs/TransactionPreviewUtils.ts:302-309): The functiongetTransactionPreviewTextAndTranslationPathscorrectly initializespreviewHeaderTextusinggetExpenseTypeTranslationKey(getTransactionType(transaction))(which resolves to'iou.cash'= "Cash" for a scanned receipt). However, at line 308-309, whenisTransactionScanningis true, it overrides this to'common.receipt'= "Receipt":IOU report table path (
src/components/TransactionItemRow/DataCells/TypeCell.tsx:42-45):TypeCellcallsgetExpenseTypeTranslationKey(getTransactionType(transaction))directly with no scanning override, so it correctly shows "Cash".The
getTransactionTypefunction (src/libs/TransactionUtils/index.ts:337-364) classifies a scanned receipt (no card, not distance) asCASH, andgetExpenseTypeTranslationKeymaps that to'iou.cash'= "Cash". The scanning override inTransactionPreviewUtils.tsis the sole cause of the inconsistency.What changes do you think we should make in order to solve the problem?
In
src/libs/TransactionPreviewUtils.ts, update the scanning branch (line 309) to preserve the actual expense type instead of hardcoding'common.receipt':Change the scanning branch from using
'common.receipt'to usinggetExpenseTypeTranslationKey(getTransactionType(transaction)), with'common.receipt'as a fallback. This ensures the chat preview label matches the IOU report page for all expense types (Cash, Card, etc.) during scanning.What alternative solutions did you explore? (Optional)
Alternative: Remove the scanning branch entirely. Since line 302 already initializes
previewHeaderTextwith the correct expense type, theisTransactionScanningbranch could be removed so it falls through to the default. This also works but is slightly less explicit about the scanning case.Note:
MoneyRequestReportPreviewContent.tsx:371also hardcodes'common.receipt'for scanning transactions in multi-expense report previews. That may warrant a similar fix but is a separate concern from the 1:1 chat preview inconsistency reported here.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.14 remaining items
melvin-bot commentedon Mar 14, 2026
📣 @Eskalifer1 You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖
Eskalifer1 commentedon Mar 27, 2026
It seems we don’t plan to fix this bug (#85410 (comment)). Let's handle payment here; the PR has been created and approved with a C+, so it looks like 100% compensation.
I can close the PR now or later - let me know!
cc: @heyjennahay @marcaaron @mkhutornyi
heyjennahay commentedon Mar 30, 2026
@Eskalifer1 I sent you an offer in Upwork, can you please let me know when you accept it? https://www.upwork.com/nx/wm/offer/110938585
Eskalifer1 commentedon Mar 30, 2026
Hi @heyjennahay, thank you! I have accepted!
heyjennahay commentedon Apr 1, 2026
Payment summary
@Eskalifer1 paid $250 via Upwork. Contract and job closed. Thanks everyone
mkhutornyi commentedon Apr 1, 2026
@heyjennahay please post payment summary for me. paid via ND
heyjennahay commentedon Apr 1, 2026
Oh my goodness @mkhutornyi I'm so sorry. For some reason I thought I checked and saw the C+ was from one of our agencies which is why I didn't include you. I must have messed it up with another GH I was processing at the same time.
Payment summary:
@mkhutornyi please request $250 payment via NewDot.
Thanks and sorry again 🙈
quinthar commentedon Apr 4, 2026
Approved $250 to @mkhutornyi