Skip to content

[Due for payment 2025-07-04] [$250] Expense - Expense preview disappears in workspace chat after report workspace change fails #64459

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.68-3
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): sdnsoidjiosjdosd3jo@gmail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Admin invites member to workspace A only.
  • Member has another workspace other than workspace A.
  1. Go to staging.new.expensify.com
  2. [Member] Go to workspace chat of the invited workspace.
  3. [Member] Create an expense in the workspace chat.
  4. [Member] Click Submit on the expense preview.
  5. [Admin] Go to workspace chat with member and open expense report.
  6. [Admin] Click More > Hold.
  7. [Admin] Enter reason and save it.
  8. [Member] Open expense report.
  9. [Member] Click More > Change workspace.
  10. [Member] Select another workspace.
  11. [Member] Dismiss the error message that the report workspace cannot be changed.
  12. [Member] Go back to the main workspace chat.

Expected Result:

The expense preview will be displayed in the main workspace chat because changing report workspace fails.

Actual Result:

The expense preview disappears in the main workspace chat when changing report workspace fails.
The expense preview is also not seen in the other workspace chat where the report was intended to change to.

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

buf.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021935495089280919000
  • Upwork Job ID: 1935495089280919000
  • Last Price Increase: 2025-06-19
  • Automatic offers:
    • nkdengineer | Contributor | 107740356
Issue OwnerCurrent Issue Owner: @maddylewis

Activity

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

    @melvin-bot

    Triggered auto assignment to @maddylewis (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. nkdengineer commented on Jun 18, 2025

    @nkdengineer
    Contributor

    Proposal

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

    The expense preview disappears in the main workspace chat when changing report workspace fails.
    The expense preview is also not seen in the other workspace chat where the report was intended to change to.

    What is the root cause of that problem?

    The report preview is reverted in the failureData here but oldReportPreviewAction is undefined

    value: {[oldReportPreviewActionID]: oldReportPreviewAction},

    The reason is allReportActions is created with the key is reportID but we get the oldReportPreviewAction with the key is the report action collection key

    const oldReportPreviewAction = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${oldWorkspaceChatReportID}`]?.[oldReportPreviewActionID];

    allReportActions[reportID] = actions;

    So the report preview is still marked as deleted, and it disappears

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

    We should get the correct oldReportPreviewAction here

    const oldReportPreviewAction = allReportActions?.[oldWorkspaceChatReportID]?.[oldReportPreviewActionID]; 
    

    const oldReportPreviewAction = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${oldWorkspaceChatReportID}`]?.[oldReportPreviewActionID];

    And also update the deleted in originalMessage to null in failureData here

    value: {[oldReportPreviewActionID]: {
        ...oldReportPreviewAction,
        originalMessage: {
            deleted: null,
        },
        ...(!Array.isArray(oldReportPreviewAction?.message) && {
            message: {
                deleted: null,
            },
        }),
    }},
    

    value: {[oldReportPreviewActionID]: oldReportPreviewAction},

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

    Update changeReportPolicy test and verify that the report preview is updated correct when the API fails

    What alternative solutions did you explore? (Optional)

    NA

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 19, 2025
  5. changed the title [-]Expense - Expense preview disappears in workspace chat after report workspace change fails[/-] [+][$250] Expense - Expense preview disappears in workspace chat after report workspace change fails[/+] on Jun 19, 2025
  6. melvin-bot commented on Jun 19, 2025

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

    @melvin-bot

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

  9. dukenv0307 commented on Jun 19, 2025

    @dukenv0307
    Contributor

    @nkdengineer's proposal looks good to me, let's fix all places that use allReportActions?.[${ONYXKEYS.COLLECTION.REPORT_ACTIONS... in Report.ts

    🎀👀🎀 C+ reviewed

  10. melvin-bot commented on Jun 19, 2025

    @melvin-bot

    Triggered auto assignment to @marcaaron, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  11. 4 remaining items

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jun 27, 2025
  13. changed the title [-][$250] Expense - Expense preview disappears in workspace chat after report workspace change fails[/-] [+][Due for payment 2025-07-04] [$250] Expense - Expense preview disappears in workspace chat after report workspace change fails[/+] on Jun 27, 2025
  14. melvin-bot commented on Jun 27, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on Jun 27, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.71-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-07-04. 🎊

    For reference, here are some details about the assignees on this issue:

  16. melvin-bot commented on Jun 27, 2025

    @melvin-bot

    @dukenv0307 @maddylewis @dukenv0307 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  17. dukenv0307 commented on Jun 30, 2025

    @dukenv0307
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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/58078/files#r2174144236

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. Yes

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Test:

    • Precondition:

    Admin invites member to workspace A only.
    Member has another workspace other than workspace A.

    1. Go to staging.new.expensify.com
    2. [Member] Go to workspace chat of the invited workspace.
    3. [Member] Create an expense in the workspace chat.
    4. [Member] Click Submit on the expense preview.
    5. [Admin] Go to workspace chat with member and open expense report.
    6. [Admin] Click More > Hold.
    7. [Admin] Enter reason and save it.
    8. [Member] Open expense report.
    9. [Member] Click More > Change workspace.
    10. [Member] Select another workspace.
    11. [Member] Dismiss the error message that the report workspace cannot be changed.
    12. [Member] Go back to the main workspace chat.
    13. The expense preview will be displayed in the main workspace chat because changing report workspace fails.

    Do we agree 👍 or 👎

  18. maddylewis commented on Jul 2, 2025

    @maddylewis
    Contributor

    Payment Overview + Final To-Dos

  19. JmillsExpensify commented on Jul 9, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @dukenv0307

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions