You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[QA Retest & Close] Tax amount is not negative after splitting expense & selecting non-zero tax rate during split #103723
Version Number: 9.5.7-0 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:http://github.com/Expensify/App/pull/102175 Email or phone of affected tester (no customers):jsoidjndoiniodnsjojd@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:
Go to staging.new.expensify.com
Go to workspace chat.
Create an expense with negative expense and 0% tax rate.
Open the expense.
Click More > Split.
Click on any split.
Click Tax rate.
Change to 5% rate.
Click Save > Save.
Open the split with 5% tax rate.
Expected Result:
Tax amount will be negative after splitting expense and selecting non-zero tax rate during splitting.
Actual Result:
Tax amount is not negative after splitting expense and selecting non-zero tax rate during splitting.
It only changes to negative after reselecting tax rate on expense details thread.
👋 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:
Identify the pull request that introduced this issue and revert it.
Root cause: When you save a single split, updateSplitExpenseField forces the split's tax to be positive at src/libs/actions/IOU/SplitExpenseItems.ts:900: taxAmount: Math.abs(transactionDetails?.taxAmount ?? 0). Production has the same line, so refund splits have already been saved with the wrong tax sign. Before the causing PR, the expense details page wrapped tax in Math.abs(), which hid the error. That PR removed the wrapper at MoneyRequestView.tsx:380.
Recommendation: roll forward. Reverting the causing PR would hide the split bug again and bring back the positive-tax display bug it fixed. In updateSplitExpenseField, set the tax sign from the split's final amount. Do this after the distance recalculation (lines 907-922):
Add a test in tests/actions/IOU/SplitExpenseItemsTest.ts: a split with amount: -500 and a 5% tax rate should end with a negative taxAmount.
Investigation details
How the wrong sign reaches the UI
All other split paths in SplitExpenseItems.ts keep the tax sign the same as the amount sign. Lines 447, 640, 755, and 975 use calculateTaxAmount(taxValue, signedAmount, …). Only line 900 strips the sign. A -$10 split at 5% gets taxAmount: +48 next to amount: -1000.
SplitTransactionUpdate.ts:662-663 passes that value to getMoneyRequestInformation. MoneyRequestBuilder.ts:1568 then negates it for expense reports, so the stored value is -48. The value sent to the API at SplitTransactionUpdate.ts:366 has the same wrong sign.
getTaxAmount() flips the stored sign, so the split shows +$0.48.
Why re-picking the tax rate on the expense thread fixes it: That path calls updateMoneyRequestTaxRate with the real stored transaction (DynamicIOURequestStepTaxRatePage.tsx:159,180), and that function sets the sign correctly.
Why tie the sign to the amount instead of just deleting Math.abs: In the split tax-rate step, the draft amount is flipped by getAmount(…, false, true), and getTransactionDetails(draft) flips it back. Deleting Math.abs works only because those two flips cancel. It would break if the draft's reportID were not an expense report.
Confidence: High, based on code tracing. I didn't reproduce the bug in the app.
Demoting: The wrong sign already exists in production, so demoting is reasonable if a quick fix isn't possible. Tax totals are still incorrect, so fixing it is better.
changed the title [-]Tax amount is not negative after splitting expense & selecting non-zero tax rate during split[/-][+][QA Retest & Close] Tax amount is not negative after splitting expense & selecting non-zero tax rate during split[/+]on Oct 12, 2026
Activity
applause-bot commentedon Oct 12, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
melvin-bot commentedon Oct 12, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #102175
melvin-bot commentedon Oct 12, 2026
@grgia you have been assigned to this deploy blocker because you reviewed the offending PR: #102175
melvin-bot commentedon Oct 12, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Oct 12, 2026
👋 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:
MelvinBot commentedon Oct 12, 2026
Deploy Blocker Analysis
Causing PR: Show negative tax amount for negative expenses on the expense details page. It exposed this bug but didn't create it.
Root cause: When you save a single split,
updateSplitExpenseFieldforces the split's tax to be positive at src/libs/actions/IOU/SplitExpenseItems.ts:900:taxAmount: Math.abs(transactionDetails?.taxAmount ?? 0). Production has the same line, so refund splits have already been saved with the wrong tax sign. Before the causing PR, the expense details page wrapped tax inMath.abs(), which hid the error. That PR removed the wrapper at MoneyRequestView.tsx:380.Recommendation: roll forward. Reverting the causing PR would hide the split bug again and bring back the positive-tax display bug it fixed. In
updateSplitExpenseField, set the tax sign from the split's final amount. Do this after the distance recalculation (lines 907-922):Add a test in
tests/actions/IOU/SplitExpenseItemsTest.ts: a split withamount: -500and a 5% tax rate should end with a negativetaxAmount.Investigation details
How the wrong sign reaches the UI
SplitExpenseItems.tskeep the tax sign the same as the amount sign. Lines 447, 640, 755, and 975 usecalculateTaxAmount(taxValue, signedAmount, …). Only line 900 strips the sign. A -$10 split at 5% getstaxAmount: +48next toamount: -1000.SplitTransactionUpdate.ts:662-663passes that value togetMoneyRequestInformation.MoneyRequestBuilder.ts:1568then negates it for expense reports, so the stored value is-48. The value sent to the API atSplitTransactionUpdate.ts:366has the same wrong sign.getTaxAmount()flips the stored sign, so the split shows +$0.48.Why re-picking the tax rate on the expense thread fixes it: That path calls
updateMoneyRequestTaxRatewith the real stored transaction (DynamicIOURequestStepTaxRatePage.tsx:159,180), and that function sets the sign correctly.Why tie the sign to the amount instead of just deleting
Math.abs: In the split tax-rate step, the draft amount is flipped bygetAmount(…, false, true), andgetTransactionDetails(draft)flips it back. DeletingMath.absworks only because those two flips cancel. It would break if the draft'sreportIDwere not an expense report.Other checklist PRs ruled out
redistributeExcludingFrozenSplits). This flow doesn't use that.initSplitExpenseItemData. This flow doesn't reach that code.Confidence: High, based on code tracing. I didn't reproduce the bug in the app.
Demoting: The wrong sign already exists in production, so demoting is reasonable if a quick fix isn't possible. Tax totals are still incorrect, so fixing it is better.
[-]Tax amount is not negative after splitting expense & selecting non-zero tax rate during split[/-][+][QA Retest & Close] Tax amount is not negative after splitting expense & selecting non-zero tax rate during split[/+]kavimuru commentedon Oct 12, 2026
Reverted #103763
Retest.Web.103723.mp4