Skip to content

[$250] Track - Unexpected error deleting this expense appears when categorize expense #72379

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.2.29-1
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-1236/folder/13176877/41237354/945415942
Email or phone of affected tester (no customers): applausetester+gm1038204@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Lenovo 80ES / Windows 10 Pro
App Component: Other

Action Performed:

  1. Go to OD> Login with E account> Submit unreported expense
  2. Go to ND> Navigate to Self DM chat> Create manual track distance
  3. Select Categorize it from the whisper menu> Upgrade and finish the process ( workspace will be created)
  4. Select any category and complete the process

Expected Result:

There should be no errors

Actual Result:

"Unexpected error deleting this expense" error appears when categorize expense

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

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021978153473233190254
  • Upwork Job ID: 1978153473233190254
  • Last Price Increase: 2025-12-09
Issue OwnerCurrent Issue Owner: @QichenZhu

Activity

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

    @melvin-bot

    Triggered auto assignment to @lschurr (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. mukhrr commented on Oct 11, 2025

    @mukhrr
    Contributor

    Expected Result:
    There should be no errors

    @lschurr what is detailed expected behavior here? We move expense to default WS after clicking Categorize ?

  4. mukhrr commented on Oct 11, 2025

    @mukhrr
    Contributor

    Proposal

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

    When trying to categorize unreported expense we get error.

    What is the root cause of that problem?

    Wheb categorizing we are trying to get report policy id from unreported expense which is logically wrong.

    App/src/libs/actions/IOU.ts

    Lines 6395 to 6398 in 0400484

    const policyParams: TrackedExpensePolicyParams = {
    policyID: chatReport?.policyID,
    isDraftPolicy,
    };

    As there is no report for expense, we make its policyId FAKE. And sending fake policy id causes the error from BE:

    {
        "jsonCode": 500,
        "message": "Invalid empty PolicyID for the policy store",
        "requestID": "98d01c31cdd7dbe6-LAX",
        "onyxData": []
    }
    

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

    We need to give policyId of workspace on top when chatReport doesn't have real policyId.

        const policyParams: TrackedExpensePolicyParams = {
                        policyID: chatReport?.policyID === CONST.POLICY.ID_FAKE || !chatReport?.policyID ? participant.policyID : chatReport?.policyID,
                    isDraftPolicy,
                };
    Image

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

    N/A

    What alternative solutions did you explore? (Optional)

    I think there will still be a bug from BE side even after our fix. It responses with error preventing user from expected behavior:

    {
        "jsonCode": 400,
        "message": "400 Unique Constraints Violation",
        "source": "auth-via-api",
        "onyxData": [],
        "requestID": "98d022663cd6d9ce-SJC"
    }
    
  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 14, 2025
  6. changed the title [-]Track - Unexpected error deleting this expense appears when categorize expense[/-] [+][$250] Track - Unexpected error deleting this expense appears when categorize expense[/+] on Oct 14, 2025
  7. melvin-bot commented on Oct 14, 2025

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

    @melvin-bot

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

  10. melvin-bot commented on Oct 20, 2025

    @melvin-bot

    @QichenZhu Huh... This is 4 days overdue. Who can take care of this?

  11. 32 remaining items

  12. QichenZhu commented on Nov 26, 2025

    @QichenZhu
  13. mvtglobally commented on Nov 30, 2025

    @mvtglobally

    Issue not reproducible during KI retests. (Third week)

  14. melvin-bot commented on Dec 2, 2025

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  15. melvin-bot commented on Dec 4, 2025

    @melvin-bot

    @QichenZhu 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  16. QichenZhu commented on Dec 4, 2025

    @QichenZhu
    Contributor

    @lschurr, should we put this on hold or close it out based on #72555?

    We discussed in this Slack thread whether it still makes sense to keep the track flows in NewDot, given that we're adding the Support for unreported expense in NewDot. We though about removing them, given that the beta is only enabled for Applause and deploy blockers keep coming. We decided not to completely remove the functionality, but disable them until we’ll likely come back to the track case sometime soon.

  17. melvin-bot commented on Dec 9, 2025

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  18. melvin-bot commented on Dec 9, 2025

    @melvin-bot

    @QichenZhu Eep! 4 days overdue now. Issues have feelings too...

  19. lschurr commented on Dec 10, 2025

    @lschurr
    Contributor

    Going to close this one for now

  20. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Dec 10, 2025
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 contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions