[cp stag] Fix Not Here page when opening card spend rules on a Collect workspace - #97704
Conversation
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safarifix.mov |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Bug: Upgrade modal briefly shows before navigating to More features Screen.Recording.2026-08-03.at.5.14.28.PM.mov |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f64b14f605
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ckers Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Fixed |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
|
@MelvinBot review |
| // Replace rather than push: Back from the upgrade page must not land on a page Collect can't use. | ||
| hasRedirectedToUpgrade.current = tryNavigateToControlPolicyUpgrade(policy, CONST.UPGRADE_FEATURE_INTRO_MAPPING.rules.alias, upgradeBackTo, true); | ||
| // `policy` changes identity on unrelated writes, so gate on the derived flags instead. | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps |
There was a problem hiding this comment.
Is this comment not avoidable?
And I think this should be added to seatbelt, not here
There was a problem hiding this comment.
Policy is in the deps now. The hasRedirectedToUpgrade ref already short-circuits re-runs after the first successful navigation.
|
🤖 Reviewed the code. The approach is sound and I don't see a blocker — the fix correctly unblocks Collect while preserving Control-only gating. A few notes below. Why the fix is correct
Worth confirming (non-blocking)
Testing noteI did not runtime-reproduce the exact flow — it requires a Collect workspace with an Expensify card issued and the |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
On native, Add rule page briefly shows Screen.Recording.2026-08-03.at.5.58.06.PM.mov |
I reproduced this in playstore version v9.4.46-10. Not blocker as happening on production |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
Fix Not Here page when opening card spend rules on a Collect workspace (cherry picked from commit 6f20c4d) (cherry-picked to staging by arosiclair)
|
🚀 Cherry-picked to staging by https://github.com/arosiclair in version: 9.4.48-3 🚀
|
Help site review — no docs changes requiredI reviewed the changes in this PR against the help site articles under Conclusion: No help-site updates are needed. Why: This is a navigation/access-control bug fix. It changes where a Collect admin lands when they open a Control-only spend rules page — a clean Control upgrade page instead of the "Not Here" dead-end — and preserves the correct The behavior this PR touches is already accurately reflected in the docs:
The Control-plan requirement predates this PR (it was established in #95310); this PR only fixes how Collect workspaces are routed to the upgrade path. Since no PR is being created, there is no linked help site PR to review. |
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.4.48-3 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Cherry-picked to staging by https://github.com/arosiclair in version: 9.4.49-0 🚀
|
|
🤖 Help site review: no changes required. This PR is an access-gating bug fix, not a user-facing feature or copy change, so nothing under Why no docs update is neededWhat the PR changes: It removes the The plan requirement it enforces is already documented. The behavior confirms Expensify Card Spend rules require the Control plan (Collect admins are sent to the upgrade flow). The help site already covers this:
Since Rules are Control-only and Spend rules require Rules, the article's stated requirement already implies the Control plan. The PR simply fixes the how you're blocked (upgrade prompt vs. a dead-end error page) — an internal UX correction that the help articles don't document. @Krishna2323, if you'd still like the Spend rules article to call out the Control plan requirement explicitly (rather than by implication via the Workspace Rules link), let me know and I'll open a draft docs PR for that clarification. Otherwise no action is needed here. |
Explanation of Change
#95310 added the
CONTROLaccess variant to the spend rule pages to keep Card restrictions Control-only. However, access variants inAccessOrNotFoundWrapperare ANDed, so they can only render Not Found when any required variant is missing. As a result, Collect workspaces were hard-blocked from these pages.This also bypassed the existing feature disabled → More features upgrade flow that these pages previously used.
The main entry point affected is Wallet → Card details → Edit spend rules. That action is available to any workspace admin and doesn't perform any plan or feature checks, so it bypasses the upgrade gating already implemented by the Rules pages.
Fix
CONTROLaccess variant from the three spend rule pages.Navigation.dismissModalAndReplaceso pressing Back from the upgrade flow doesn't return to a page Collect workspaces can't access.backTo, so after upgrading the user is returned to where they started.Fixed Issues
$ #97632
PROPOSAL:
Tests
Offline tests
QA Steps
Same as test
Verify that no errors appear in the JS console
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
web_chrome_with_beta.mp4
web_chrome_without_beta.mp4