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 2025-10-23] Workspace - Disabling a toggle in Expense Reports triggers eReceipts to Enabled in non-USD WS #69565
Go to Rules > enable one of the toggle from Expense Reports section
Go offline
Disable the toggle turned on in step 4
Go online
Expected Result:
Disabling a toggle in the Expense Reports section while offline should not automatically enable eReceipts
Actual Result:
When a toggle in the Expense Reports section is disabled while offline, eReceipts are automatically enabled for non-USD workspaces once the app goes back online.
In non-USD workspaces, when a user toggles any “Expense Report” rule (e.g., Prevent Self-Approval, Auto-Approval, Auto-Reimburse) while offline, the app unexpectedly sets eReceipts to enabled after reconnecting. This regression affects multiple platforms and was reproduced in staging and production.
Root Cause
The Individual Expense Rules screen (IndividualExpenseRulesSection) renders the eReceipts toggle using a reusable Switch component. Even though the switch is visually disabled for non‑USD currencies (disabled={policyCurrency !== CONST.CURRENCY.USD}),
it still wires up an onToggle callback to setWorkspaceEReceiptsEnabled(policyID, !areEReceiptsEnabled)
If any other rule is toggled offline, queued updates merge policy data when reconnecting. Because getWorkspaceEReceiptsEnabledOnyxData misconfigures its failure‑recovery payload, it writes back pendingFields.defaultBillable. This leaves pendingFields.eReceipts stale and can cause the offline queue to reapply a previous eReceipts value (typically true) when reconciling requests.
Proposed Fix
1. Correct the Onyx failure payload for eReceipts
In getWorkspaceEReceiptsEnabledOnyxData, replace the defaultBillable keys with eReceipts in the failureData section. The function should revert only the eReceipts field and its pending/error fields on failure
his ensures other updates don’t inadvertently reset eReceipts.
2. Guard the eReceipts action in the UI
Modify IndividualExpenseRulesSection.tsx so that the onToggle handler checks policyCurrency === CONST.CURRENCY.USD before calling setWorkspaceEReceiptsEnabled. Alternatively, pass a no‑op disabledAction prop to the Switch so the pressable is disabled correctly. This prevents accidental dispatches of the eReceipts API in non‑USD workspaces, even if the component receives spurious clicks
3. Early exit in the action
Add a defensive early return in setWorkspaceEReceiptsEnabled so that if the workspace’s outputCurrency !== USD the function simply returns. This enforces the currency constraint at the action layer in case future callers omit the check.
4. Audit other rule actions
Verify that other actions in the Expense Reports and Individual Expense Rules sections (setPolicyPreventSelfApproval, enableAutoApprovalOptions, etc.) do not queue or merge unrelated fields. Confirm there is no call site that toggles eReceipts outside of USD policies.
Acceptance Criteria
In non‑USD workspaces, toggling any rule in Expense Reports while offline and then going online does not enable eReceipts.
The eReceipts toggle does not trigger any action or network call in non‑USD workspaces.
The pendingFields and errorFields for eReceipts are correctly cleared on success/failure.
All related settings work correctly in USD workspaces.
Manual testing across Android (app & web), iOS (app & web), Windows Chrome, macOS Chrome/Safari/Desktop reproduces the original issue on main and confirms the fix.
Test Plan
Set up a non‑USD workspace on staging.
Baseline: Ensure eReceipts is disabled. Enable one Expense Report rule. Go offline, disable it, then reconnect. Confirm eReceipts remains disabled.
Repeat steps for each rule in both the Expense Report Rules and Individual Expense Rules sections.
Switch to USD workspace and verify that eReceipts can still be toggled normally and that failure scenarios roll back correctly.
Use dev tools to inspect Onyx pendingFields for eReceipts before and after offline/online transitions.
📣 @danilomarkovic99! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
📣 @danilomarkovic99! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
I've already included contributor details in my previous comment. Sharing it here separately.
Activity
melvin-bot commentedon Aug 29, 2025
Triggered auto assignment to @VictoriaExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.danilomarkovic99 commentedon Aug 31, 2025
Contributor details
Expensify account email: danilo.markovic.dm@gmail.com
Upwork Profile link: https://www.upwork.com/freelancers/~016340fa4ac4f99e69
Problem Summary
In non-USD workspaces, when a user toggles any “Expense Report” rule (e.g., Prevent Self-Approval, Auto-Approval, Auto-Reimburse) while offline, the app unexpectedly sets eReceipts to enabled after reconnecting. This regression affects multiple platforms and was reproduced in staging and production.
Root Cause
The Individual Expense Rules screen (IndividualExpenseRulesSection) renders the eReceipts toggle using a reusable Switch component. Even though the switch is visually disabled for non‑USD currencies
(disabled={policyCurrency !== CONST.CURRENCY.USD}),it still wires up an onToggle callback to
setWorkspaceEReceiptsEnabled(policyID, !areEReceiptsEnabled)If any other rule is toggled offline, queued updates merge policy data when reconnecting. Because
getWorkspaceEReceiptsEnabledOnyxDatamisconfigures its failure‑recovery payload, it writes backpendingFields.defaultBillable. This leavespendingFields.eReceiptsstale and can cause the offline queue to reapply a previous eReceipts value (typically true) when reconciling requests.Proposed Fix
1. Correct the Onyx failure payload for eReceipts
In
getWorkspaceEReceiptsEnabledOnyxData, replace thedefaultBillablekeys witheReceiptsin thefailureDatasection. The function should revert only the eReceipts field and its pending/error fields on failurehis ensures other updates don’t inadvertently reset eReceipts.
2. Guard the eReceipts action in the UI
Modify
IndividualExpenseRulesSection.tsxso that the onToggle handler checkspolicyCurrency === CONST.CURRENCY.USDbefore callingsetWorkspaceEReceiptsEnabled. Alternatively, pass a no‑opdisabledActionprop to the Switch so the pressable is disabled correctly. This prevents accidental dispatches of the eReceipts API in non‑USD workspaces, even if the component receives spurious clicks3. Early exit in the action
Add a defensive early return in
setWorkspaceEReceiptsEnabledso that if the workspace’soutputCurrency !== USDthe function simply returns. This enforces the currency constraint at the action layer in case future callers omit the check.4. Audit other rule actions
Verify that other actions in the Expense Reports and Individual Expense Rules sections (
setPolicyPreventSelfApproval,enableAutoApprovalOptions, etc.) do not queue or merge unrelated fields. Confirm there is no call site that toggles eReceipts outside of USD policies.Acceptance Criteria
Test Plan
pendingFieldsfor eReceipts before and after offline/online transitions.melvin-bot commentedon Aug 31, 2025
📣 @danilomarkovic99! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
danilomarkovic99 commentedon Aug 31, 2025
I've already included contributor details in my previous comment. Sharing it here separately.
Contributor details
Expensify account email: danilo.markovic.dm@gmail.com
Upwork Profile link: https://www.upwork.com/freelancers/~016340fa4ac4f99e69
melvin-bot commentedon Sep 1, 2025
@VictoriaExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Sep 2, 2025
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
melvin-bot commentedon Sep 2, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @truph01 (
External)49 remaining items
truph01 commentedon Nov 3, 2025
@VictoriaExpensify I'm not eligible for NewDot payment yet, please send me the Upwork offer, thank you!
VictoriaExpensify commentedon Nov 13, 2025
Oh sorry @truph01 , I don't know why I thought you were! Sending an offer now
VictoriaExpensify commentedon Nov 14, 2025
@truph01 upwork profile - https://www.upwork.com/offer/109391536
VictoriaExpensify commentedon Nov 14, 2025
Offer sent @truph01 https://www.upwork.com/nx/wm/offer/109471897
VictoriaExpensify commentedon Nov 16, 2025
Updated Payment summary:
C: @thelullabyy - Paid $250 via Upwork
C+: @truph01 - Paid $250 via Upwork
thelullabyy commentedon Jan 30, 2026
Kindly bump for payout on upwork
thelullabyy commentedon Feb 12, 2026
@VictoriaExpensify could you please check this comment? Thanks
VictoriaExpensify commentedon Feb 24, 2026
@thelullabyy and I have chatted 1:1, this is now resolved