Skip to content

[HOLD for payment 2024-05-01] [$500] Workspace – “Submitted $amount” system message appears for a moment when Employee submit IOU #38579

Closed

Description

@lanitochka17

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: 1.4.54-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4434476
Email or phone of affected tester (no customers): applausetester+jp_e_category@applause.expensifail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Log in as Employee of a Collect WS
  3. Open WS chat and request a money
  4. Open IOU and press Submit button in the header

Expected Result:

“You submitted this report to Admin (email)” system message appears when Employee submit IOU

Actual Result:

“Submitted $amount” system message appears for a moment when Employee submit IOU and then appears “You submitted this report to Admin (email)”

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6419091_1710846730210.Submitted__amount.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01304a705cb67bed22
  • Upwork Job ID: 1770177446924410880
  • Last Price Increase: 2024-03-19
  • Automatic offers:
    • situchan | Reviewer | 0
    • FitseTLT | Contributor | 0
Issue OwnerCurrent Issue Owner: @garrettmknight

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 19, 2024
  2. melvin-bot commented on Mar 19, 2024

    @melvin-bot

    Triggered auto assignment to @garrettmknight (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. lanitochka17 commented on Mar 19, 2024

    @lanitochka17
    Author

    @garrettmknight FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

  4. moved this to Release 1: Spring 2024 (May) in [#whatsnext] #wave-collecton Mar 19, 2024
  5. garrettmknight commented on Mar 19, 2024

    @garrettmknight
    Contributor

    Confirmed the bug - I think it fits in #wave-collect.

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 19, 2024
  7. changed the title [-]Workspace – “Submitted $amount” system message appears for a moment when Employee submit IOU[/-] [+][$500] Workspace – “Submitted $amount” system message appears for a moment when Employee submit IOU[/+] on Mar 19, 2024
  8. melvin-bot commented on Mar 19, 2024

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 19, 2024
  10. melvin-bot commented on Mar 19, 2024

    @melvin-bot

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

  11. FitseTLT commented on Mar 19, 2024

    @FitseTLT
    Contributor

    Proposal

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

    Workspace – “Submitted $amount” system message appears for a moment when Employee submit IOU

    What is the root cause of that problem?

    The optimistic submited report action contains message with only one fragment of submitted amount

    App/src/libs/actions/IOU.ts

    Lines 3893 to 3894 in 0d700c3

    const optimisticSubmittedReportAction = ReportUtils.buildOptimisticSubmittedReportAction(expenseReport?.total ?? 0, expenseReport.currency ?? '', expenseReport.reportID);
    const parentReport = ReportUtils.getReport(expenseReport.parentReportID);

    App/src/libs/ReportUtils.ts

    Lines 3175 to 3176 in 0d700c3

    iouMessage = `submitted ${amount}`;
    break;

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

    The optimistic submitted report action should have all the message fragments same as what the BE returns
    like

    [
      {
        "type": "TEXT",
        "style": "strong",
        "text": "You"
      },
      {
        "type": "TEXT",
        "style": "normal",
        "text": " submitted this report"
      },
      {
        "type": "TEXT",
        "style": "normal",
        "text": " to "
      },
      {
        "type": "TEXT",
        "style": "strong",
        "text": "F A T (test.engfitsum@gmail.com)"
      }
    ]
    

    Submitted to account can be taken from policy.ownerAccountID so We can update buildOptimisticSubmittedReportAction to

      function buildOptimisticSubmittedReportAction(amount: number, currency: string, expenseReportID: string, policy): OptimisticSubmittedReportAction {
        const originalMessage = {
            amount,
            currency,
            expenseReportID,
        };
        const ownerPersonalDetails = getPersonalDetailsForAccountID(policy.ownerAccountID);
    
        return {
            actionName: CONST.REPORT.ACTIONS.TYPE.SUBMITTED,
            actorAccountID: currentUserAccountID,
            automatic: false,
            avatar: getCurrentUserAvatarOrDefault(),
            isAttachment: false,
            originalMessage,
            message: [
                {
                    type: CONST.REPORT.MESSAGE.TYPE.TEXT,
                    style: 'strong',
                    text: 'You',
                },
                {
                    type: CONST.REPORT.MESSAGE.TYPE.TEXT,
                    style: 'normal',
                    text: ' submitted this report',
                },
                {
                    type: CONST.REPORT.MESSAGE.TYPE.TEXT,
                    style: 'normal',
                    text: ' to ',
                },
                {
                    type: CONST.REPORT.MESSAGE.TYPE.TEXT,
                    style: 'strong',
                    text: `${ownerPersonalDetails.displayName} (${ownerPersonalDetails.login})`,
                },
            ],
    

    We can move this change to getIOUReportActionMessage (only updating SUBMITTED case)
    And moreover We can think of more complex logic especially to determine the first and last fragments, especially the last because the way display name and login are displayed depend on their existence.

    What alternative solutions did you explore? (Optional)

  12. 53 remaining items

  13. hungvu193 commented on May 2, 2024

    @hungvu193
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: [NoQA] Feat: Add submit action #28947
    • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/App/pull/28947/files#r1586975839
    • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
    • Determine if we should create a regression test for this bug: No

    This is a minor bug, so I don't think we need a regression test for it. Instead, we need to ensure that the optimistic data from the client matches what is returned from the server to avoid this kind of bug in the future.

  14. melvin-bot commented on May 8, 2024

    @melvin-bot

    @garrettmknight, @pecanoro, @hungvu193, @FitseTLT Whoops! This issue is 2 days overdue. Let's get this updated quick!

  15. pecanoro commented on May 9, 2024

    @pecanoro
    Contributor

    @garrettmknight All yours!

  16. moved this from Release 1: Spring 2024 (May) to Done in [#whatsnext] #wave-collecton May 9, 2024
  17. situchan commented on Oct 8, 2025

    @situchan
    Contributor

    Am I eligible for partial compensation?
    I fully reviewed proposals and 🎀 here and I went OOO while waiting for PR to be raised.

  18. mallenexpensify commented on Oct 8, 2025

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @situchan due $250 via Upwork

    @situchan can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~021976061167883058467

  19. situchan commented on Oct 9, 2025

    @situchan
    Contributor

    Accepted thanks

  20. garrettmknight commented on Oct 9, 2025

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething 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