Skip to content

[Due for payment 2026-03-23] [$250] Report-Error and infinite loading when submitting track expense to WS with workflows disabled #78359

Closed

Description

@nlemma

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.2.86-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-2487/folder/13176877/41237352/1089918656
Email or phone of affected tester (no customers): ibellicotest+2230@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Critical User Impact
Device used: Motorola MotoG60 / Android 12 / Chrome ( mWeb / Hybrid app) - Windows 11 / Chrome
App Component: Money Requests

Action Performed:

Prerequisite: Account has Self DM.
Prerequisite 2: Account has a workspace with workflows disabled.

  1. Open the staging.new.expensify.com website.
  2. Create a manual expense and submit it to Self DM.
  3. Tap on "Submit it to someone" option on whisper message.
  4. Select a workspace and submit the expense to it.
  5. Open the expense report.
  6. Note that "Unexpected error submitting this expense" and "Unexpected error deleting this expenses" error messages appear on report.
  7. Dismiss the errors.
  8. Note that you are redirected back to chat, and report is now displayed empty.
  9. Reopen report.
  10. Note that infinite skeleton loader is displayed.
  11. Tap on "More"
  12. Note that there is no option to delete the empty report.
  13. Tap on "Retract"
  14. Note that no action is triggered.

Expected Result:

User should be able to submit a track expense to a workspace, even if workflows are disabled.

Actual Result:

"Unexpected error submitting this expenses" and "Unexpected error deleting this expenses" error messages appear at the same time when submitting a track expense to a workspace with workflows disabled. Also, when errors are dismissed, report displays infinite skeleton loader and it can´t be deleted or retracted.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7035755_1766466245358.Flow.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022003566431205148800
  • Upwork Job ID: 2003566431205148800
  • Last Price Increase: 2025-12-30
Issue OwnerCurrent Issue Owner: @cead22

Activity

  1. added
    Daily
    Bug
    on Dec 23, 2025
  2. melvin-bot commented on Dec 23, 2025

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (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. added
    External
    on Dec 23, 2025
  4. melvin-bot commented on Dec 23, 2025

    @melvin-bot
  5. changed the title [-]Report-Error and infinite loading when submitting track expense to WS with workflows disabled[/-] [+][$250] Report-Error and infinite loading when submitting track expense to WS with workflows disabled[/+] on Dec 23, 2025
  6. added
    Help Wanted
    on Dec 23, 2025
  7. melvin-bot commented on Dec 23, 2025

    @melvin-bot

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

  8. CortneyOfstad commented on Dec 23, 2025

    @CortneyOfstad
    Contributor

    Hey @suneox! There is a proposal above for you to review. Thanks!

  9. suneox commented on Dec 24, 2025

    @suneox
    Contributor

    Thank for all proposals I'll take a look at this one soon

  10. h7nj9 commented on Dec 24, 2025

    @h7nj9

    Proposal

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

    When a user submits a track expense to a workspace that has workflows disabled, the submission fails with two error messages appearing simultaneously:

    1. "Unexpected error submitting this expense"
    2. "Unexpected error deleting this expense"

    After dismissing these errors, the user is redirected back to chat, and the report displays an infinite skeleton loader. The report cannot be deleted or retracted, leaving the user in a broken state.

    What is the root cause of that problem?

    The root cause is in the getTrackExpenseInformation function in src/libs/actions/IOU.ts. When submitting a track expense to a workspace, the code generates createdWorkspaceParams (workspace-related parameters) whenever the report is a draft, regardless of whether the target workspace has workflows enabled.

    These workspace parameters are then sent to the backend API via the CATEGORIZE_TRACKED_EXPENSE command. When workflows are disabled on the workspace, the backend rejects the request because it receives workspace-related parameters that should only be present when workflows are enabled. This causes the API call to fail, triggering both the "submitting" error (from the failed categorization) and "deleting" error (from the failed cleanup operation that attempts to remove the transaction from the original track expense report).

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

    We should modify the getTrackExpenseInformation function to only generate createdWorkspaceParams when:

    1. The report is a draft (creating a new workspace), already happening here, OR
    2. The policy has workflows enabled (submitting to an existing workspace with workflows)

    Specifically, we need to add a check before generating workspace params:

    • Check if isDraftReportLocal is true (creating new workspace), OR
    • Check if policy?.areWorkflowsEnabled is true (existing workspace with workflows enabled)

    If neither condition is met (i.e., submitting to an existing workspace with workflows disabled), we should skip generating createdWorkspaceParams entirely. This way, the API call will proceed without workspace-related parameters, which the backend can handle correctly when workflows are disabled.

    const shouldGenerateWorkspaceParams = isDraftReportLocal || policy?.areWorkflowsEnabled;
    
        if (shouldGenerateWorkspaceParams) {
            const workspaceData = buildPolicyData({

    What alternative solutions did we explore? (Optional)

    We need to prevent the bad API call or update the backend to handle when workflows are disabled.

    1. Update backend validation to gracefully handle workspace params when workflows are disabled, but this might not be the correct approach since workspace params shouldn't be sent in this scenario.
    2. On client side, we could add validation before making the API call to check if workflows are enabled, but this is essentially what my proposed solution does in a more direct way.
  11. melvin-bot commented on Dec 24, 2025

    @melvin-bot

    📣 @h7nj9! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  12. 80 remaining items

  13. melvin-bot commented on Mar 16, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. melvin-bot commented on Mar 16, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.37-10 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 2026-03-23. 🎊

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

    • @suneox requires payment through NewDot Manual Requests
    • @Uzaifm127 requires payment (Needs manual offer from BZ)
  15. melvin-bot commented on Mar 16, 2026

    @melvin-bot

    @suneox 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]

  16. added
    Daily
    and removed
    Weekly
    on Mar 22, 2026
  17. CortneyOfstad commented on Mar 23, 2026

    @CortneyOfstad
    Contributor

    @suneox — can you please complete the checklist?

    @Uzaifm127 — I sent you an offer via Upwork here. Please let me know once you accept

  18. Uzaifm127 commented on Mar 23, 2026

    @Uzaifm127
    Contributor

    @CortneyOfstad Thanks.

    Accepted the offer, requested the payment.

  19. suneox commented on Mar 23, 2026

    @suneox
    Contributor

    BugZero Checklist:

    • [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.

      There is no offending PR. This is an edge case related to restoring the initial state from a long time ago in the original feature, and another PR that enhanced failureData also missed this case at Refactor convertTrackedExpenseToRequest function #56808 Fix/79072 - Opening 1:1 expense in offline loads infinitely submitted from self dm #80213

    • [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.

      N/A: It isn't an impactful bug since it only affects optimistic data

  20. CortneyOfstad commented on Mar 23, 2026

    @CortneyOfstad
    Contributor

    Payment Summary

    @suneox — to be paid $250 via NewDot
    @Uzaifm127 — paid $250 via Upwork

    Regression Test

    Per comment here, test is not needed

  21. trjExpensify commented on Mar 27, 2026

    @trjExpensify
    Contributor

    approved $250 for @suneox

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions