Skip to content

Split expense silently reverts when the workspace's stored tax code doesn't exactly match the code the App sends #99987

Closed

Description

@melvin-bot

Problem

Splitting an expense fails for some workspaces. The App applies the split optimistically, the API rejects it, and the App rolls it back — the user sees the original expense reappear with only a generic "An unexpected error occurred" message.

The API returns 404 Tax code not found in policy from SplitTransaction.

Why it happens

The workspace's tax rate is present and enabled, but its stored external tax ID carries a legacy trailing space (for example 40330102 ). The App sends the code without the space, and the backend's split validation compares the two exactly, so the lookup misses and the split is rejected.

The backend comparison is being tracked internally. Two things are App-side:

  1. Worth confirming whether the App can send the tax code exactly as the policy stores it. The App appears to receive an already-normalized copy, in which case this part is purely backend.
  2. The failure surfaces a generic error and silently reverts, with no hint that the tax rate is the problem. The split flow should show an actionable message instead.

Action performed

  1. Use a workspace with Taxes enabled whose stored tax external ID has a trailing space (legacy Expensify Classic data).
  2. Create an expense using that tax rate.
  3. Open the expense > More > Split > Save.

Expected result

The expense splits.

Actual result

A generic error appears and the split reverts to the original expense.

Impact

Small but persistent. Over the last 8 days, roughly 0.2% of split requests carrying a tax code failed this way, across two workspaces. It started on Aug 20, when #94434 began sending an explicit per-split taxCode.

Related

Reported in Slack.

Issue OwnerCurrent Issue Owner: @ishpaul777

Activity

  1. self-assigned this
    on Sep 1, 2026
  2. hoangzinh commented on Sep 4, 2026

    @hoangzinh
    Contributor

    @luacmartins @ishpaul777 I think it's a BE issue (although it was hard for me to reproduce, because I couldn't create a taxCode (externalId) with a trailing space in both ND & OD). But I think MelvinBot found here makes sense to me

    The App sends the code without the space, and the backend's split validation compares the two exactly, so the lookup misses and the split is rejected.

    Can I request for BE support for this issue?

  3. melvin-bot commented on Sep 4, 2026

    @melvin-bot
    Author

    @truph01 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  4. melvin-bot commented on Sep 5, 2026

    @melvin-bot
    Author

    @truph01 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  5. luacmartins commented on Sep 5, 2026

    @luacmartins
    Contributor

    @ishpaul777 are you avaialble to work on the BE fix?

  6. ishpaul777 commented on Sep 5, 2026

    @ishpaul777
    Contributor

    yes self assigned

  7. self-assigned this
    on Sep 5, 2026
  8. ishpaul777 commented on Sep 5, 2026

    @ishpaul777
    Contributor
  9. hoangzinh commented on Sep 11, 2026

    @hoangzinh
    Contributor

    How is the BE PR going @ishpaul777

  10. melvin-bot commented on Sep 14, 2026

    @melvin-bot
    Author

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

  11. ishpaul777 commented on Sep 14, 2026

    @ishpaul777
    Contributor
  12. m-natarajan commented on Sep 15, 2026

    @m-natarajan

    @ishpaul777 @luacmartins Blocked from retesting this as this requires taxCode (externalId) with a trailing space

  13. luacmartins commented on Sep 15, 2026

    @luacmartins
    Contributor

    @ishpaul777 QA is blocked on testing this one

  14. ishpaul777 commented on Sep 15, 2026

    @ishpaul777
    Contributor

    @luacmartins I an unsure on how to test this realistically prod, can you check the Slack where this was reported if it has more clear steps (i cant access)

  15. luacmartins commented on Sep 15, 2026

    @luacmartins
    Contributor

    I requested that the team retest this since it involves a specific customer's data. I'll report back if the fix doesn't work.

  16. melvin-bot commented on Sep 22, 2026

    @melvin-bot
    Author

    @ishpaul777 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  17. ishpaul777 commented on Sep 22, 2026

    @ishpaul777
    Contributor

    @luacmartins any updates

  18. luacmartins commented on Sep 22, 2026

    @luacmartins
    Contributor

    Not yet. No updates from the customer.

  19. luacmartins commented on Sep 22, 2026

    @luacmartins
    Contributor

    I think we can consider this done and reopen if we hear otherwise.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions