Skip to content

Expense - Tax is not saved when changing amount currency and tax rate during bulk edit #107623

Open

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.5.49-2
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #106067
Email or phone of affected tester (no customers): sdjinosdnjiojdsio@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Enable Taxes.
  • Set Tax Rate 1 (5%) as foreign currency default in Tax settings.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create two expenses.
  4. Open the report.
  5. Bulk select both expenses.
  6. Enter amount and select foreign currency.
  7. Open Tax dropdown and select Tax exempt (0%) rate.
  8. Click Save.
  9. Open any edited expense.

Expected Result:

Tax field will show the selected Tax exempt (0%) rate.

Actual Result:

Tax field shows Tax Rate 1 (5%), which disregards the changes during bulk edit.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7320199_1795205191376.9.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7320199

Issue OwnerCurrent Issue Owner: @mkhutornyi

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 20, 2026
  2. applause-bot commented on Nov 20, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/07159758dc347398374dfa283ef5e8dfdc33b2ab9d8af6f18420ff6ae3f0bc3d

  3. expensify-chore-bot commented on Nov 20, 2026

    @expensify-chore-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #106067

  4. expensify-chore-bot commented on Nov 20, 2026

    @expensify-chore-bot

    @mountiny @ikevin127 you have been assigned to this deploy blocker because you reviewed the offending PR: #106067

  5. expensify-chore-bot commented on Nov 20, 2026

    @expensify-chore-bot

    @DylanDylann you have been assigned to this deploy blocker because you authored the offending PR: #106067

  6. expensify-chore-bot commented on Nov 20, 2026

    @expensify-chore-bot

    💬 A slack conversation has been started in #expensify-open-source

  7. github-actions commented on Nov 20, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  8. mountiny commented on Nov 20, 2026

    @mountiny
    Contributor

    @MelvinBot can you make a proposal to fix this?

  9. MelvinBot commented on Nov 20, 2026

    @MelvinBot
    Contributor

    🤖 Web test steps verification results: ❌ fail

    The deploy-blocker investigator identified a plausible client-side cause exposed by Update the Edit multiple flow, but the complete failure mechanism remains unconfirmed. Web verification was blocked by a blank app page; the reported bug was neither reproduced nor disproved.

    Blank app page blocking tax verification

    Step Status
    Enable Taxes, configure foreign-currency default, create expenses, and verify bulk-edit tax persistenceBlocked before setup: the app returned zero snapshot nodes. No expenses were created and no request payload was captured.

    Investigation findings — preliminary proposal

    What is the root cause of that problem?
    The feature PR newly enables combined amount/currency editing in SearchEditMultiplePage.tsx:370–393. Existing bulk-edit logic then removes fields equal to their original values before serializing the update. If the expenses were already exempt, this can discard an explicitly selected exempt rate while retaining the currency change. The server applying the foreign-currency default would explain the symptom, but that step—and the original expense tax values—was not verified.

    What changes do you think we should make?
    First capture the original tax values and outgoing request. If the explicit selection is omitted, make filtering dependency-aware: preserve the explicitly selected tax code, value, and calculated amount together when currency changes, including zero values. Retain ordinary no-op filtering and existing edit restrictions.

    What alternative solutions did you explore?
    A numeric-zero picker bug is not supported: the dropdown stores a tax-code string. Removing all no-op filtering would be unnecessarily broad. If the request already contains the exempt selection, the proposed filtering fix is insufficient and investigation must follow the response.

    Resolution recommendation: Keep the deploy blocker. Prefer a targeted fix only after payload confirmation; otherwise consider reverting the feature before deployment. Regression coverage should assert both expenses’ request payloads and tax rates after save and refresh, covering initially exempt and mixed-rate expenses.
    Blank app page blocking tax verification
    ❌

    view run · no recording available

  10. MelvinBot commented on Nov 20, 2026

    @MelvinBot
    Contributor

    🤖 Web test steps verification results: ⚠️ partial

    Code investigation confirmed that bulk editing can discard an explicitly selected exemption, but did not establish why these expenses subsequently show 5%. Web verification was blocked during workspace tax setup, so the proposal below remains provisional.

    Workspace tax setup blocked

    Step Status
    Configure workspace taxesCreated a USD workspace, but navigation and overlay limitations prevented enabling Taxes.
    Workspace tax setup blocked
    ❌
    Create expenses, bulk-edit to exempt, and verify persistenceNot reached because tax setup was incomplete. No expenses were edited.
    ❌
    Inspect stored tax fields and outgoing updates; develop proposalRequest/response bodies and stored transaction fields were unavailable through the browser tools. Static investigation established the following.

    Proposal — provisional

    What is the root cause of that problem?
    Bulk editing constructs the selected tax code, percentage, and amount, then independently removes fields matching each expense’s original values in BulkEdit.ts:374–394. For an already-exempt expense, this drops the explicit exemption while retaining the currency change. However, the optimistic transaction remains exempt; subsequent application of the foreign-currency default is not confirmed.

    What changes do you think we should make in order to solve the problem?
    If the failing request omits the exemption, preserve the accepted tax code, percentage, and calculated amount together whenever currency changes alongside an explicit tax selection—even when those values match the original expense. Apply this after existing eligibility checks; retain ordinary no-op filtering otherwise. Include numeric zero.

    What alternative solutions did you explore?
    A stale label is another possibility: MoneyRequestView.tsx:1049 can prefer an existing taxName over the correctly updated exemption. Preserving the request’s tax fields would not fix that separate display problem.

    Required confirmation: Capture original tax fields, outgoing updates, and returned tax fields. Missing exemption identifies the filtering path; exempt stored values with a 5% label identify the display path. The evidence currently does not establish which caused this report.

    Regression coverage: Test originally exempt, originally 5%, and mixed-rate expenses. Assert every eligible request’s complete tax bundle, then verify both expenses after save and refresh. Also retain controls for no explicit tax selection and restricted tax editing.
    ⚠️

    view run · view recording

  11. mkhutornyi commented on Nov 20, 2026

    @mkhutornyi
    Contributor

    The server ignores a tax code sent with a currency change.

    With the client fixed to keep the selected rate when the currency changes, bulk edit now sends this to UpdateMoneyRequest:

    {"currency":"EUR","taxCode":"id_TAX_EXEMPT","taxValue":"0%","taxAmount":0,"amount":1000}

    The response still saves Tax Rate 1 (5%) with a €0.48 tax amount. Offline the expense shows Tax exempt, then it flips to 5% when the response arrives. So UpdateMoneyRequest applies the workspace's foreign currency default after a currency change, even when the same request sends a tax code.

    1. Enable Taxes. Leave Tax exempt (0%) as the workspace default and set Tax Rate 1 (5%) as the foreign currency default
    2. Create two USD expenses in the workspace chat and open the report
    3. Select both, click Edit multiple
    4. Enter 10, pick EUR, pick Tax exempt (0%), click Save
    5. Open either expense

    Expected Result: Tax exempt (0%), tax amount €0.00
    Actual Result: Tax Rate 1 (5%), tax amount €0.48

    Backend fix: in UpdateMoneyRequest, re-apply the default rate after a currency change only when the request sends no taxCode. If one is sent, keep it and use the sent taxValue and taxAmount, even if the code matches the one already stored.

    Frontend fix (needed too): bulk edit dropped a tax code equal to the stored one but still sent the new currency, so exempt never reached the server. The fix keeps taxCode, taxValue and taxAmount after removeUnchangedBulkEditFields whenever the currency changes and a rate was picked. PR: #107630

    fix.mov
  12. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Nov 21, 2026
  13. mountiny commented on Nov 21, 2026

    @mountiny
    Contributor

    I think we can demote if this issue spans backend as well, I think this is very narrow edge case

  14. ikevin127 commented on Nov 21, 2026

    @ikevin127
    Contributor

    Does the PR #107630 for this need my review ?

  15. mkhutornyi commented on Nov 21, 2026

    @mkhutornyi
    Contributor

    Does the PR #107630 for this need my review ?

    yes eventually. Holding test for backend fix

  16. ikevin127 commented on Nov 21, 2026

    @ikevin127
    Contributor

    Ok then, please tag me on the PR whenever review is required 🙌

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.DailyKSv2EngineeringReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions