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
Tax amount field remains unchanged after changing amount when submitting expense from self DM #92823
Version Number: 9.4.0-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:#92059 Email or phone of affected tester (no customers):jsodinjosdjsoinjsiojs@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:
Run Onyx.merge('betas', ['newManualExpenseFlow']); in console.
Enable Taxes in workspace settings.
Go to staging.new.expensify.com
Go to self DM.
Create a manual expense with 5% rate.
Click Submit it to someone.
Select workspace chat.
On confirm page, change the amount to any value.
Expected Result:
Tax amount field will update accordingly when amount is changed.
Actual Result:
Tax amount field remains unchanged after changing amount when submitting from self DM
👋 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.
Submitting an expense from a self DM ("Submit it to someone") runs the move-from-track-expense flow — the SUBMIT action makes isMovingTransactionFromTrackExpense return true. That flag short-circuits tax-amount recalculation, so when you change the amount on the confirmation page the stored transaction.taxAmount is never updated, and the inline tax field keeps showing the stale value.
Two places block the recalc when moving:
TaxController.tsx:52-56 — the effect that persists the recalculated tax amount via setMoneyRequestTaxAmount returns early when isMovingTransactionFromTrackExpense is true.
useTaxAmount.ts:68 — even if the effect ran, this returns the originaltransaction.taxAmount (instead of calculateTaxAmount(...)) whenever moving and a tax amount already exists.
The inline field's value is read straight from the transaction (getTaxAmount(transactionForHelpers) at TaxFields.tsx:55), so with the stored value frozen the displayed tax never changes — matching the report exactly.
Why this only repros from a self DM, and why the input remount doesn't save it
The non-moving create flow (e.g. starting directly from a workspace chat) does not hit the guard, so TaxController re-runs setMoneyRequestTaxAmount on every amount change and the field updates correctly. Only the move flows (SUBMIT/SHARE/CATEGORIZE) are affected.
The inline NumberWithSymbolForm is keyed by taxAmountInputKey which includes the expense amount, so it does remount when the amount changes — but it remounts onto the same stale transaction.taxAmount, so the user sees no change.
This is design intent vs. bug tension: the guard was added to preserve the moved expense's original tax amount on mount. The fix must keep that initial preservation while still recalculating once the user actively edits the amount.
What changes do you think we should make in order to solve the problem?
Allow the tax amount to recalculate on the confirmation page when the user changes the expense amount, even in the move-from-track-expense flow, while still preserving the original tax amount on initial load.
Concretely:
In useTaxAmount.ts:68, stop returning the frozen transaction.taxAmount once the amount has changed from the value that produced it — recompute via calculateTaxAmount(...) instead.
In TaxController.tsx, let the tax-amount persistence effect run for the move flow when the amount changes (rather than bailing out unconditionally on isMovingTransactionFromTrackExpense), so the recomputed value is written to the draft.
What alternative solutions did you explore? (Optional)
Recompute and persist taxAmount directly inside the amount-change handler for the move flow (so the controller guards stay untouched), gating on "amount actually changed" to avoid clobbering a user-entered tax amount on first load.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/92823) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
godzillaxbox19982014-lgtm commented on Jun 6, 2026
The local evidence matches this recurring failure shape: optimistic transaction/report data is written to one Onyx key but the visible list reads another derived key. Here, src/libs/actions/IOU/SplitTransactionUpdate.ts:757 and src/pages/iou/SplitExpensePage.tsx:269 do not agree on the same workspace name, expense report, DM value, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.
What changes do you think we should make in order to solve the problem?
Update src/libs/actions/IOU/SplitTransactionUpdate.ts:757 to derive workspace name, expense report, DM from the report/transaction source that owns this flow before the value is consumed.
Carry the same normalized value through src/pages/iou/SplitExpensePage.tsx:269; that follows the safer family move to align optimistic/success/failure data with the selector consumed by the screen, so the write/optimistic/read paths agree instead of only changing the visible component.
Keep the change inside the Reports, Expenses, IOU, Transactions surface and avoid changing payment actions, personal/deleted policies.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add or update a regression in tests/unit/ReportUtils*.ts for the exact issue flow: Tax amount field remains unchanged after changing amount when submitting expense from self DM.
Cover the counter-case near src/libs/actions/IOU/SplitTransactionUpdate.ts:757 so valid existing workspace name, expense report, DM behavior still works.
Manually repeat the issue steps after the patch and confirm the visible state/action is no longer stale.
What alternative solutions did you explore? (Optional)
I would not add a broad new condition outside these referenced paths; the safer fix is to keep workspace name, expense report, DM consistent at the first read/write boundary shown above.
Activity
applause-bot commentedon Jun 5, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/f1a7ec343f6be7a7a00d2f462eab55796f989935f56cf32688024a2680eeac01
melvin-bot commentedon Jun 5, 2026
@JS00001 recently merged #92059, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon Jun 5, 2026
Triggered auto assignment to @cristipaval (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Jun 5, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 5, 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 Jun 5, 2026
Proposal
What is the root cause of that problem?
Submitting an expense from a self DM ("Submit it to someone") runs the move-from-track-expense flow — the
SUBMITaction makesisMovingTransactionFromTrackExpensereturntrue. That flag short-circuits tax-amount recalculation, so when you change the amount on the confirmation page the storedtransaction.taxAmountis never updated, and the inline tax field keeps showing the stale value.Two places block the recalc when moving:
TaxController.tsx:52-56— the effect that persists the recalculated tax amount viasetMoneyRequestTaxAmountreturns early whenisMovingTransactionFromTrackExpenseis true.useTaxAmount.ts:68— even if the effect ran, this returns the originaltransaction.taxAmount(instead ofcalculateTaxAmount(...)) whenever moving and a tax amount already exists.The inline field's value is read straight from the transaction (
getTaxAmount(transactionForHelpers)atTaxFields.tsx:55), so with the stored value frozen the displayed tax never changes — matching the report exactly.Why this only repros from a self DM, and why the input remount doesn't save it
TaxControllerre-runssetMoneyRequestTaxAmounton every amount change and the field updates correctly. Only the move flows (SUBMIT/SHARE/CATEGORIZE) are affected.NumberWithSymbolFormis keyed bytaxAmountInputKeywhich includes the expenseamount, so it does remount when the amount changes — but it remounts onto the same staletransaction.taxAmount, so the user sees no change.What changes do you think we should make in order to solve the problem?
Allow the tax amount to recalculate on the confirmation page when the user changes the expense amount, even in the move-from-track-expense flow, while still preserving the original tax amount on initial load.
Concretely:
useTaxAmount.ts:68, stop returning the frozentransaction.taxAmountonce the amount has changed from the value that produced it — recompute viacalculateTaxAmount(...)instead.TaxController.tsx, let the tax-amount persistence effect run for the move flow when the amount changes (rather than bailing out unconditionally onisMovingTransactionFromTrackExpense), so the recomputed value is written to the draft.What alternative solutions did you explore? (Optional)
Recompute and persist
taxAmountdirectly inside the amount-change handler for the move flow (so the controller guards stay untouched), gating on "amount actually changed" to avoid clobbering a user-entered tax amount on first load.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/92823)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
godzillaxbox19982014-lgtm commentedon Jun 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Tax amount field remains unchanged after changing amount when submitting expense from self DM
What is the root cause of that problem?
I traced this to the path that handles
workspace name, expense report, DM:newTransactionReportID):const newTransactionReportID = isSelfDMPerDiemSplit ? CONST.REPORT.UNREPORTED_REPORT_ID : (workspaceExpenseReportID ?? splitExpense?.reportID);addSplitExpenseField):addSplitExpenseField(transaction, draftTransaction, transactionReport, effectivePolicy, isDraftSelfDMContext);if):if (isSelfDMSplit && !effectivePolicy && !hasAnyPaidWorkspace && reportID) {src/libs/actions/IOU/SplitTransactionUpdate.ts:757andsrc/pages/iou/SplitExpensePage.tsx:269do not agree on the sameworkspace name, expense report, DMvalue, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.What changes do you think we should make in order to solve the problem?
src/libs/actions/IOU/SplitTransactionUpdate.ts:757to deriveworkspace name, expense report, DMfrom the report/transaction source that owns this flow before the value is consumed.src/pages/iou/SplitExpensePage.tsx:269; that follows the safer family move to align optimistic/success/failure data with the selector consumed by the screen, so the write/optimistic/read paths agree instead of only changing the visible component.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
tests/unit/ReportUtils*.tsfor the exact issue flow: Tax amount field remains unchanged after changing amount when submitting expense from self DM.src/libs/actions/IOU/SplitTransactionUpdate.ts:757so valid existingworkspace name, expense report, DMbehavior still works.What alternative solutions did you explore? (Optional)
workspace name, expense report, DMconsistent at the first read/write boundary shown above.melvin-bot commentedon Jun 9, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
m-natarajan commentedon Jun 9, 2026
issue not reproducible using Staging v9.4.0-5.
Screen.Recording.2026-06-09.at.7.43.09.AM.mov