Skip to content

[$250] Search - Expense report preview on search shows "Submitted XX$" for an unsubmitted expense #63081

Closed

Description

@vincdargento

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: 9.1.54-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): ibellicotest+918@gmail.com
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 - Android 12 - Chrome / Windows 10 - Chrome
App Component: Search

Action Performed:

Prerequisite: Account has at least one workspace created.
Prerequisite 2: Workspace has delayed submissions enabled.

  1. Open the Expensify app.
  2. Open any workspace chat.
  3. Submit a manual expense to it.
  4. Once redirected to chat again, tap on the search icon on the top right corner.
  5. Note that expense report preview shows "Submitted XX$" despite expense not being submitted yet.

Expected Result:

Expense report preview shouldn´t display an expense as submitted when it wasn´t submitted yet.

Actual Result:

Expense report preview on search, shows the message "Submitted XX$" for an expense that wasn´t submitted yet.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021928504743481126876
  • Upwork Job ID: 1928504743481126876
  • Last Price Increase: 2025-05-30
Issue OwnerCurrent Issue Owner: @alitoshmatov

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 29, 2025
  2. melvin-bot commented on May 29, 2025

    @melvin-bot

    Triggered auto assignment to @lydiabarclay (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.

  3. FitseTLT commented on May 29, 2025

    @FitseTLT
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Search - Expense report preview on search shows "Submitted XX$" for an unsubmitted expense

    What is the root cause of that problem?

    The last message of the expense report is the iou action linked to last expense and we display a submitted copy with the amount here for this type of iou actions here

    } else if (isMoneyRequestAction(lastReportAction)) {
    const properSchemaForMoneyRequestMessage = getReportPreviewMessage(report, lastReportAction, true, false, null, true);
    lastMessageTextFromReport = formatReportLastMessageText(properSchemaForMoneyRequestMessage);

    App/src/libs/ReportUtils.ts

    Lines 4358 to 4365 in b436ae8

    if (amount !== undefined && lastActorID && !isPreviewMessageForParentChatReport) {
    const amountToDisplay = convertToDisplayString(Math.abs(amount), currency);
    // We only want to show the actor name in the preview if it's not the current user who took the action
    const requestorName =
    lastActorID && lastActorID !== currentUserAccountID ? getDisplayNameForParticipant({accountID: lastActorID, shouldUseShortForm: !isPreviewMessageForParentChatReport}) : '';
    return `${requestorName ? `${requestorName}: ` : ''}${translateLocal('iou.submittedAmount', {formattedAmount: amountToDisplay, comment})}`;
    }

    What changes do you think we should make in order to solve the problem?

    We can display another copy to represent expenses and the copy can be suggested by the design team but we can use some parameters as the amount and even prepend the requestor like the current one (when it is not the current user).

    App/src/libs/ReportUtils.ts

    Lines 4358 to 4365 in b436ae8

    if (amount !== undefined && lastActorID && !isPreviewMessageForParentChatReport) {
    const amountToDisplay = convertToDisplayString(Math.abs(amount), currency);
    // We only want to show the actor name in the preview if it's not the current user who took the action
    const requestorName =
    lastActorID && lastActorID !== currentUserAccountID ? getDisplayNameForParticipant({accountID: lastActorID, shouldUseShortForm: !isPreviewMessageForParentChatReport}) : '';
    return `${requestorName ? `${requestorName}: ` : ''}${translateLocal('iou.submittedAmount', {formattedAmount: amountToDisplay, comment})}`;
    }

    For instance, currently the message of the iou action the BE sets follows the format $XX expense so we can use a similar copy.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    WE can update the tests or create one to assert that the last message text of the expene report when the last action is an expense is aligned with the changes we make.

    What alternative solutions did you explore? (Optional)

  4. bernhardoj commented on May 30, 2025

    @bernhardoj
    Contributor

    This is being handled here.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 30, 2025
  6. changed the title [-]Search - Expense report preview on search shows "Submitted XX$" for an unsubmitted expense[/-] [+][$250] Search - Expense report preview on search shows "Submitted XX$" for an unsubmitted expense[/+] on May 30, 2025
  7. melvin-bot commented on May 30, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 30, 2025
  9. melvin-bot commented on May 30, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (External)

  10. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 30, 2025
  11. lydiabarclay commented on May 30, 2025

    @lydiabarclay
    Contributor

    @bernhardoj can this be closed then?

  12. bernhardoj commented on May 31, 2025

    @bernhardoj
    Contributor

    Yes

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions