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
[Due for payment 2026-03-31] Tax rate section does not appear when merging expenses after creating workspaces offline #85156
Version Number: 9.3.37-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:#83587 Email or phone of affected tester (no customers):osidjnosndojnisonj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Go offline.
Create two workspaces.
Enable Taxes in both workspaces.
Go to first workspace chat and create an expense with 0% tax rate.
Go to second workspace chat and create an expense with 5% tax rate.
Open the second expense.
Click More > Merge.
Select the first expense > Continue.
Expected Result:
Tax rate section will appear because both expenses have different tax rate.
Actual Result:
Tax rate section does not appear when merging expenses after creating workspaces offline.
👋 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.
The issue is in the getMergeableDataAndConflictFields function:
// Temporarily skip merging tax value if either policy has tax tracking disabledif(field===taxValue&&(!targetTransactionPolicy?.tax?.trackingEnabled||!sourceTransactionPolicy?.tax?.trackingEnabled)){continue;}
When workspaces are created offline:
Policy objects may not be fully synchronized to Onyx yet
The tax.trackingEnabled property may be undefined or incomplete
The condition !targetTransactionPolicy?.tax?.trackingEnabled evaluates to true (because undefined is falsy)
The code skips adding taxValue to the conflict fields array
Result: No tax rate section appears in the merge UI, even though both workspaces have tax enabled
The code works correctly when workspaces are created online (policies are fully synced), but fails in offline mode when policy data is incomplete or not yet persisted properly to Onyx.
Please re-state the problem that we are trying to solve in this issue.
When workspaces are created offline and taxes are enabled on them, the tax rate section does not appear when merging two expenses that have different tax rates. Users expect to see a tax rate selector since the expenses have different tax rates (e.g., 0% vs 5%).
What is the root cause of that problem?
The guard at MergeTransactionUtils.ts:232 skips the taxValue field entirely when either policy's tax.trackingEnabled is falsy:
For offline-created workspaces, the tax property is not included in the optimistic policy data generated by buildPolicyData (Policy.ts:2449-2557). The workspace creation uses Onyx.METHOD.SET which creates the full policy object, but the tax field is absent from that object.
The tax.trackingEnabled property is only set when enablePolicyTaxes is called separately (Policy.ts:4692-4699), which uses Onyx.METHOD.MERGE to add tax: { trackingEnabled: true }.
There are two scenarios that cause the tax data to be missing when the merge flow reads it:
Draft-to-workspace conversion: If the workspace creation goes through createDraftWorkspace (Policy.ts:2953-3012) first, then the user enables taxes (MERGE), and then the workspace is finalized via createWorkspace (SET without tax data), the SET overwrites the previously-merged tax data.
Missing optimistic data: The buildPolicyData function never includes the tax property. When the guard at line 232 checks policy?.tax?.trackingEnabled, policy.tax is undefined, making undefined?.trackingEnabled evaluate to undefined (falsy), which triggers the continue and skips the tax field.
The merge flow loads policies from Onyx via useMergeTransactions (useMergeTransactions.ts:75-76), and passes them to getMergeableDataAndConflictFields in DetailsReviewPage (line 59-66). Since taxValue is never added to conflictFields, the tax rate section is never rendered.
What changes do you think we should make in order to solve the problem?
Include tax: { trackingEnabled: false } in the optimistic policy data in buildPolicyData (Policy.ts) and createDraftWorkspace, so the tax property always exists on policies. This ensures:
When enablePolicyTaxes MERGEs tax: { trackingEnabled: true }, it updates an existing property rather than relying on the MERGE to create a new nested object
The guard at MergeTransactionUtils.ts:232 correctly evaluates false (tax explicitly disabled) vs the current undefined (tax property missing)
If the workspace creation SET happens after a tax MERGE, the tax: { trackingEnabled: false } would be present but could be overridden by extracting the tax feature state from featuresMap (similar to how areDistanceRatesEnabled is already handled at line 2430)
What alternative solutions did you explore? (Optional)
An alternative would be to change the guard at MergeTransactionUtils.ts:232 to check for explicitly false rather than falsy:
This would treat undefined (missing tax property) differently from false (explicitly disabled), allowing the tax section to appear when the tax property is simply missing. However, this is less robust because it changes the semantics for policies that genuinely don't have tax configured.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
changed the title [-]Tax rate section does not appear when merging expenses after creating workspaces offline[/-][+][Due for payment 2026-03-31] Tax rate section does not appear when merging expenses after creating workspaces offline[/+]on Mar 24, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.42-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@youssef-lr@dominictb The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Mar 13, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #83587
melvin-bot commentedon Mar 13, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 13, 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:
OSBotify commentedon Mar 13, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #83587 - "[Merge] Merge tax rates v2" by @dominictb (High confidence)
Related Issues: None
Recommendation: REVERT
This bug affects core merge functionality and blocks the feature from working as designed. The PR should be reverted to unblock the deploy.
Labels: No label changes needed - keeping DeployBlockerCash as this is a frontend bug requiring an App PR fix/revert.
Detailed Analysis
Evidence
PR #83587 added tax rate merging functionality. The bot correctly identified this PR as it was linked in the reproduction steps (#83587).
The bug reproduces when:
Expected: Tax rate section should appear
Actual: Tax rate section does not appear
Verification
The PR modifies
src/libs/MergeTransactionUtils.ts, which contains the logic for determining which fields to show during merge operations.Key file modified:
/home/runner/_work/App/App/src/libs/MergeTransactionUtils.tsProblematic code: Lines 231-234
Root Cause
The issue is in the
getMergeableDataAndConflictFieldsfunction:When workspaces are created offline:
tax.trackingEnabledproperty may beundefinedor incomplete!targetTransactionPolicy?.tax?.trackingEnabledevaluates totrue(becauseundefinedis falsy)taxValueto the conflict fields arrayThe code works correctly when workspaces are created online (policies are fully synced), but fails in offline mode when policy data is incomplete or not yet persisted properly to Onyx.
MelvinBot commentedon Mar 13, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When workspaces are created offline and taxes are enabled on them, the tax rate section does not appear when merging two expenses that have different tax rates. Users expect to see a tax rate selector since the expenses have different tax rates (e.g., 0% vs 5%).
What is the root cause of that problem?
The guard at
MergeTransactionUtils.ts:232skips thetaxValuefield entirely when either policy'stax.trackingEnabledis falsy:For offline-created workspaces, the
taxproperty is not included in the optimistic policy data generated bybuildPolicyData(Policy.ts:2449-2557). The workspace creation usesOnyx.METHOD.SETwhich creates the full policy object, but thetaxfield is absent from that object.The
tax.trackingEnabledproperty is only set whenenablePolicyTaxesis called separately (Policy.ts:4692-4699), which usesOnyx.METHOD.MERGEto addtax: { trackingEnabled: true }.There are two scenarios that cause the tax data to be missing when the merge flow reads it:
Draft-to-workspace conversion: If the workspace creation goes through
createDraftWorkspace(Policy.ts:2953-3012) first, then the user enables taxes (MERGE), and then the workspace is finalized viacreateWorkspace(SET without tax data), the SET overwrites the previously-merged tax data.Missing optimistic data: The
buildPolicyDatafunction never includes thetaxproperty. When the guard at line 232 checkspolicy?.tax?.trackingEnabled,policy.taxisundefined, makingundefined?.trackingEnabledevaluate toundefined(falsy), which triggers thecontinueand skips the tax field.The merge flow loads policies from Onyx via
useMergeTransactions(useMergeTransactions.ts:75-76), and passes them togetMergeableDataAndConflictFieldsinDetailsReviewPage(line 59-66). SincetaxValueis never added toconflictFields, the tax rate section is never rendered.What changes do you think we should make in order to solve the problem?
Include
tax: { trackingEnabled: false }in the optimistic policy data inbuildPolicyData(Policy.ts) andcreateDraftWorkspace, so thetaxproperty always exists on policies. This ensures:enablePolicyTaxesMERGEstax: { trackingEnabled: true }, it updates an existing property rather than relying on the MERGE to create a new nested objectMergeTransactionUtils.ts:232correctly evaluatesfalse(tax explicitly disabled) vs the currentundefined(tax property missing)tax: { trackingEnabled: false }would be present but could be overridden by extracting the tax feature state fromfeaturesMap(similar to howareDistanceRatesEnabledis already handled at line 2430)What alternative solutions did you explore? (Optional)
An alternative would be to change the guard at
MergeTransactionUtils.ts:232to check for explicitlyfalserather than falsy:This would treat
undefined(missing tax property) differently fromfalse(explicitly disabled), allowing the tax section to appear when the tax property is simply missing. However, this is less robust because it changes the semantics for policies that genuinely don't have tax configured.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.dominictb commentedon Mar 13, 2026
Checking
8 remaining items
[-]Tax rate section does not appear when merging expenses after creating workspaces offline[/-][+][Due for payment 2026-03-31] Tax rate section does not appear when merging expenses after creating workspaces offline[/+]melvin-bot commentedon Mar 24, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 24, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.42-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-03-31. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 24, 2026
@youssef-lr @dominictb The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon Mar 24, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)dominictb commentedon Mar 24, 2026
This will be paid centrally in merge project
dominictb commentedon Mar 24, 2026
Fixed