Skip to content

[$250] Expense - Inconsistent expense type shown during scan – “Receipt” in chat, “Cash” in IOU report #82591

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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:

  1. Launch app
  2. Open 1:1 chat
  3. Create 2 scan expense with camera image
  4. 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.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022029615192196932495
  • Upwork Job ID: 2029615192196932495
  • Last Price Increase: 2026-03-05

Activity

  1. Eskalifer1 commented on Feb 16, 2026

    @Eskalifer1
    Contributor

    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 forces common.receipt.
    Root cause:

    let previewHeaderText: TranslationPathOrText[] = [{translationPath: getExpenseTypeTranslationKey(getTransactionType(transaction))}];
    if (isDistanceRequest(transaction)) {
    if (RBRMessage === undefined && isUnreportedAndHasInvalidDistanceRateTransaction(transaction, policy)) {
    RBRMessage = {translationPath: 'violations.customUnitOutOfPolicy'};
    }
    } else if (isTransactionScanning) {
    previewHeaderText = [{translationPath: 'common.receipt'}];
    } else if (isBillSplit) {

    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.

    Code to update:

    } else if (isTransactionScanning) {
    previewHeaderText = [{translationPath: 'common.receipt'}];
    } else if (isBillSplit) {

    } else if (isTransactionScanning) {
        previewHeaderText = [{translationPath: getExpenseTypeTranslationKey(getTransactionType(transaction)) || 'common.receipt'}];
    } else if (isBillSplit) {

    What alternative solutions did you explore? (Optional)

    Remove the isTransactionScanning override block entirely so previewHeaderText always 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.

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 5, 2026
  3. melvin-bot commented on Mar 5, 2026

    @melvin-bot

    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.

  4. MelvinBot commented on Mar 5, 2026

    @MelvinBot
    Contributor

    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:

    1. 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 default
      let previewHeaderText = [{translationPath: getExpenseTypeTranslationKey(getTransactionType(transaction))}];
      // Lines 304-309 - scanning override replaces 'Cash' with 'Receipt'
      if (isDistanceRequest(transaction)) {
          ...
      } else if (isTransactionScanning) {
          previewHeaderText = [{translationPath: 'common.receipt'}];  // BUG
      }
    2. 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.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 5, 2026
  6. 14 remaining items

  7. melvin-bot commented on Mar 14, 2026

    @melvin-bot

    📣 @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 📖

  8. Eskalifer1 commented on Mar 27, 2026

    @Eskalifer1
    Contributor

    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

  9. heyjennahay commented on Mar 30, 2026

    @heyjennahay
    Contributor

    @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

  10. Eskalifer1 commented on Mar 30, 2026

    @Eskalifer1
    Contributor

    Hi @heyjennahay, thank you! I have accepted!

  11. heyjennahay commented on Apr 1, 2026

    @heyjennahay
    Contributor

    Payment summary

    @Eskalifer1 paid $250 via Upwork. Contract and job closed. Thanks everyone

  12. mkhutornyi commented on Apr 1, 2026

    @mkhutornyi
    Contributor

    @heyjennahay please post payment summary for me. paid via ND

  13. heyjennahay commented on Apr 1, 2026

    @heyjennahay
    Contributor

    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 🙈

  14. quinthar commented on Apr 4, 2026

    @quinthar
    Contributor

    Approved $250 to @mkhutornyi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions