[Payment due @ZhenjaHorbach] [Workspace Roles] Lock approval toggle from backend signal instead of card data - #94518
Conversation
7df2d38 to
d4311db
Compare
…ws-approval-lock-signal
New Onyx collection key holds a boolean lock signal, no PII. ExportOnyxStateTest requires every ONYXKEYS collection value to land in one of the four export buckets.
|
@ZhenjaHorbach Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-08-25.12.23.08.movAndroid: mWeb Chrome2026-08-25.12.23.08.moviOS: HybridApp2026-08-25.12.24.22.moviOS: mWeb Safari2026-08-25.12.23.08.movMacOS: Chrome / Safari2026-08-25.12.16.46.mov |
|
Changes look good 2026-08-25.12.19.16.mov |
|
🎯 @ZhenjaHorbach, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
| // should not be included as part of the policy object. The policy | ||
| // object should mirror the data as it's stored in the database. | ||
| POLICY_HAS_CONNECTIONS_DATA_BEEN_FETCHED: 'policyHasConnectionsDataBeenFetched_', | ||
| POLICY_APPROVALS_LOCKED_BY_EXPENSIFY_CARD: 'policyApprovalsLockedByExpensifyCard_', |
There was a problem hiding this comment.
I reviewed this data storage in the backend PR: https://github.com/Expensify/Auth/pull/23968#discussion_r3870825376
JmillsExpensify
left a comment
There was a problem hiding this comment.
Apologies got behind. LGTM
|
🚧 JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/JmillsExpensify in version: 9.4.64-0 🚀
|
|
Yes — one help site change is needed, and I've opened it as a draft: #99798 WhyThis PR is behavior-neutral on its own. Swapping Reviewing it did surface a real gap, though: the locked-Approvals behavior your code enforces has never been documented. What the docs PR addsOne file,
Written against UI labels verified against dev NewDot webOverall: pass — every label matched the strings in
Worth noting, since your PR description writes the toggle as "Add approvals": the on-screen title is Approvals. The docs use the live label. Evidence (2)Workflows page showing the Approvals toggle titled Approvals with subtitle Require additional approval before authorizing a payment.
More features page with the Workflows left-nav item visible
Two things I spotted but left aloneBoth are pre-existing and outside this PR's scope — flagging rather than bundling:
@ShridharGoel, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
@ShridharGoel This PR is failing in step 4 because of a regression issue #99807
The issue is reproducible in: Web,Android Bug7245599_1787957761059.bandicam_2026-08-29_01-48-14-331.mp4 |
|
Hello @ShridharGoel , Step 6 says to perform the same step for People Admin. However, People Admin does not have access to the Expensify Card Issuing feature. Does this mean that we only need to verify the approval toggle for People Admin?
|
Yes, updated the steps to make it clearer. |




Explanation of Change
The Workspace Workflows page locks the "Add approvals" toggle while the workspace uses Smart Limit Expensify Cards. It derived that lock client-side from the workspace's Expensify Card list (
isSmartLimitEnabled), which forced the backend to ship Expensify Card data to everyone who can open the page — including roles that can edit approvals but cannot read the Expensify Card feature (e.g. People admins). That exposed card data they should not see.The backend now sends a single boolean in a dedicated Onyx collection key,
policyApprovalsLockedByExpensifyCard_<policyID>(a standalone key, not a field on the policy object), and stops shipping card data to roles without Expensify Card read access (see the Auth PR). This PR consumes that boolean to lock the approval toggle and removes the Expensify Card reads the page previously used to derive the lock client-side. The Auth PR deploys first, so the boolean is always present by the time this ships.Auth counterpart: https://github.com/Expensify/Auth/pull/22489
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/644795
PROPOSAL:
Tests
Offline tests
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
MacOS: Chrome / Safari