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-07-28] [$250] For USD/Control workspace, eReceipts toggle is not auto enabled #64743
Version Number: Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@m-natarajan Slack conversation (hyperlinked to channel name): @Expensify QA
Action Performed:
Precondition: User creates a new account with USD as default currency and a control workspace
Create a new account
Select onboarding intent as Manage my team> 1 to 10 > QBD as accounting
Navigate to workspace settings- more features
Enable rules
Navigate to Rules
Expected Result:
For Control USD workspace, eReceipts toggle is auto enabled
Actual Result:
For control USD workspace, eReceipts toggle is not auto enabled
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Platforms Tested:
On which of our officially supported platforms was this issue tested:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidenceRecording.1313.mp4
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can add test for the enablePolicyRules function with control USD currency to verify that eReceipts auto-enabled
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]For USD/Control workspace, eReceipts toggle is not auto enabled[/-][+][$250] For USD/Control workspace, eReceipts toggle is not auto enabled[/+]on Jul 1, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.83-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@marcaaron@dylanexpensify@brunovjk / @daledah 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]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Activity
melvin-bot commentedon Jun 23, 2025
Triggered auto assignment to @dylanexpensify (
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.ryntgh commentedon Jun 23, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
For USD/Control workspace, eReceipts toggle is not auto enabled
What is the root cause of that problem?
enablePolicyRulesdoes not automatically enable eReceipts for Control USD workspaces when rules are enabledApp/src/libs/actions/Policy/Policy.ts
Line 3472 in a2bce5b
What changes do you think we should make in order to solve the problem?
Update the
enablePolicyRulesfunction to automatically enable eReceipts for Control USD workspaces when rules are enabled... const shouldAutoEnableEReceipts = enabled && PolicyUtils.isControlPolicy(policy) && policy?.outputCurrency === CONST.CURRENCY.USD; const onyxData: OnyxData = { optimisticData: [ { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { areRulesEnabled: enabled, preventSelfApproval: false, ...(shouldAutoEnableEReceipts && {eReceipts: true}), ...(!enabled ? DISABLED_MAX_EXPENSE_VALUES : {}), pendingFields: { areRulesEnabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE, ...(shouldAutoEnableEReceipts && {eReceipts: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}), }, }, }, ], successData: [ { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { pendingFields: { areRulesEnabled: null, ...(shouldAutoEnableEReceipts && {eReceipts: null}), }, }, }, ], failureData: [ { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { areRulesEnabled: !enabled, preventSelfApproval: policy?.preventSelfApproval, ...(shouldAutoEnableEReceipts && {eReceipts: policy?.eReceipts}), ...(!enabled ? { maxExpenseAmountNoReceipt: policy?.maxExpenseAmountNoReceipt, maxExpenseAmount: policy?.maxExpenseAmount, maxExpenseAge: policy?.maxExpenseAge, } : {}), pendingFields: { areRulesEnabled: null, ...(shouldAutoEnableEReceipts && {eReceipts: null}), }, }, }, ], }; ...App/src/libs/actions/Policy/Policy.ts
Line 3472 in a2bce5b
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can test
enablePolicyRulesto verify eReceipts auto-enabled when rules enabled on Control Workspace with USD currencyWhat alternative solutions did you explore? (Optional)
daledah commentedon Jun 23, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
For control USD workspace, eReceipts toggle is not auto enabled
What is the root cause of that problem?
We don't update the eRecepts to enable when the user enabled the Rules feature for Control USD workspace
App/src/libs/actions/Policy/Policy.ts
Lines 3524 to 3532 in a2bce5b
What changes do you think we should make in order to solve the problem?
With control USD workspace we should enable the
eReceiptsApp/src/libs/actions/Policy/Policy.ts
Lines 3524 to 3532 in a2bce5b
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can add test for the
enablePolicyRulesfunction with control USD currency to verify that eReceipts auto-enabledWhat alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
dylanexpensify commentedon Jun 25, 2025
reviewing shortly!
melvin-bot commentedon Jun 30, 2025
@dylanexpensify Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon Jun 30, 2025
@dylanexpensify Huh... This is 4 days overdue. Who can take care of this?
dylanexpensify commentedon Jul 1, 2025
Sounds like a bug! Confirming behavior real quick though in case I'm out of date on anything
dylanexpensify commentedon Jul 1, 2025
Confirmed
[-]For USD/Control workspace, eReceipts toggle is not auto enabled[/-][+][$250] For USD/Control workspace, eReceipts toggle is not auto enabled[/+]54 remaining items
melvin-bot commentedon Jul 21, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.83-5 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 2025-07-28. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 21, 2025
@marcaaron @dylanexpensify @brunovjk / @daledah 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]
dylanexpensify commentedon Jul 28, 2025
Payment summary:
Contributor: @daledah $250 via Upwork
Contributor+: @brunovjk $250 via Upwork
Please apply/request!
dylanexpensify commentedon Jul 28, 2025
@brunovjk please complete checklist, thank you!
Handle SetPolicyRulesEnabled
brunovjk commentedon Jul 28, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: Comment
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Test:
Do we agree 👍 or 👎
melvin-bot commentedon Jul 31, 2025
@dylanexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!