Repository navigation
fix: tag Control-tier upgrade features with requiredPlan for Submit workspaces - #100082
Conversation
…orkspaces Add requiredPlan: CORPORATE to Control-gated UPGRADE_FEATURE_INTRO_MAPPING entries that were still defaulting Submit upgrades to Collect (report fields, prevent-members-changing-title, GL/tax codes, multi-level tags, approvals). Derive the Submit upgrade target from the raw mapping lookup by alias so filtered entries like policyPreventMemberChangingTitle upgrade correctly. Fixes Expensify#93096
|
@thelullabyy 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] |
dylanexpensify
left a comment
There was a problem hiding this comment.
good from a product perspective 👍
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-09-06.at.21.33.31.movAndroid: mWeb ChromeScreen.Recording.2026-09-06.at.21.29.07.moviOS: HybridAppScreen.Recording.2026-09-06.at.21.01.05.moviOS: mWeb SafariScreen.Recording.2026-09-06.at.20.54.12.movMacOS: Chrome / SafariScreen.Recording.2026-09-06.at.20.51.43.mov |
| alias: 'policy-prevent-member-changing-title', | ||
| name: undefined, | ||
| icon: undefined, | ||
| requiredPlan: this.POLICY.TYPE.CORPORATE, |
There was a problem hiding this comment.
Why do we need add requiredPlan for others? Isn't the issue only about report fields @neerajbachani
There was a problem hiding this comment.
@thelullabyy the issue repro is Report fields, but the root cause is the same across Control-gated features on Submit:
- Toggle gates on
!isControlPolicy - Submit upgrade defaults to Collect when there's no
requiredPlan - After upgrade,
isControlPolicyis still false → disable/re-enable loops
That's exactly what #92872 fixed for rules-approval features; Report fields and others were just never tagged.
Why not only reportFields?
-
Same page, same bug - "Prevent members from changing custom names" uses the same gate and the same mapping pattern (
policyPreventMemberChangingTitle). I repro'd the loop there too when testing lorretheboy's one-line fix (onlyreportFieldsgetsrequiredPlan). -
Same pattern elsewhere - I also hit it on GL codes / tags on Submit (#93096 comment). Melvin flagged the same list on #92864.
-
Matches the approved approach - Product confirmed Submit → Report fields should land on Control (#93096 comment). Tagging
requiredPlan: CORPORATEon Control-gated entries is the same pattern as Upgrade Submit workspaces to the plan tier required by the unlocked feature #92872, just completing what that PR scoped down for the deploy blocker. -
policyPreventMemberChangingTitleneeds the alias lookup fix anyway - it's filtered out offeatureon the upgrade page, so addingrequiredPlanthere only works with theWorkspaceUpgradePagechange.
The goal is to fix this pattern across the codebase so we don't keep filing duplicate issues for the same root cause
There was a problem hiding this comment.
@thelullabyy Here are videos that might make it clearer.
The members toggle (policyPreventMemberChangingTitle) — same loop if we only add requiredPlan on reportFields:
Screen.Recording.2026-08-11.at.4.14.33.PM.online-video-cutter.com.mp4
Same pattern on tags / GL codes — disable → re-enable on Submit loops again:
Screen.Recording.2026-08-18.at.7.33.06.PM.mov
A reportFields-only change doesn’t cover the members toggle on the same page, that’s why policyPreventMemberChangingTitle is in this PR too.
| await waitForBatchedUpdates(); | ||
| }); | ||
|
|
||
| it('should upgrade a Submit workspace to Corporate when unlocking Report fields', async () => { |
There was a problem hiding this comment.
NAB. should we add the same test for policyPreventMemberChangingTitle.alias? the two new cases pass without the upgradeFeatureByAlias change, so nothing catches a refactor back to reading requiredPlan off feature
There was a problem hiding this comment.
@grgia Added the test for policyPreventMemberChangingTitle.alias
…e alias Add a WorkspaceUpgradeTest case for the filtered alias path so refactors that read requiredPlan from feature instead of upgradeFeatureByAlias fail CI. Also add upgrade-button testID to GenericFeaturesView for test parity with UpgradeIntroView.
|
@grgia Friendly bump on this one :) |
|
@grgia Friendly bump, thanks!! |
|
@grgia now that the PR is approved, is there anything left to get this merged? |
|
🚧 grgia 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/grgia in version: 9.4.90-0 🚀
|
|
Yes — help site changes were required. Draft PR: Docs updates for E/A#100082 Submit workspace upgrade plan per feature Why: this PR makes the upgrade target deterministic for free Submit workspaces — turning on a Control-only feature now upgrades straight to Control instead of Collect, and the workspace keeps that plan if the feature is turned off again. Two articles under What changed in the docs PR
How I verified the labels and the plan splitLabels were taken from The Control vs Collect split in the new section comes from Navigation was confirmed in code, not assumed: Written against Two things to flag:
@neerajbachani, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.4.90-2 🚀
Bundle Size Analysis (Sentry): |
Add requiredPlan: CORPORATE to Control-gated UPGRADE_FEATURE_INTRO_MAPPING entries that were still defaulting Submit upgrades to Collect (report fields, prevent-members-changing-title, GL/tax codes, multi-level tags, approvals).
Derive the Submit upgrade target from the raw mapping lookup by alias so filtered entries like policyPreventMemberChangingTitle upgrade correctly.
$ #93096
Explanation of Change
Control-tier toggles gate on
!isControlPolicy(policy), but Submit workspaces upgrading throughWorkspaceUpgradePagedefaulted to Collect (TEAM) wheneverUPGRADE_FEATURE_INTRO_MAPPINGhad norequiredPlan. After the first upgrade the workspace was still not Control, so disable → re-enable re-opened the Upgrade RHP (issue #93096).Product confirmed Submit → Report fields should upgrade to Control, stay Control after disable, and not re-prompt on re-enable.
This PR:
requiredPlan: this.POLICY.TYPE.CORPORATEto all remaining Control-gated mapping entries (reportFields,policyPreventMemberChangingTitle,multiApprovalLevels,glCodes,glAndPayrollCodes,taxCodes,multiLevelTags,approvals).WorkspaceUpgradePage, so filtered entries likepolicyPreventMemberChangingTitle(excluded from intro UI) still upgrade to Control.Collect-tier Submit features (
travelSubmit,payments, etc.) are unchanged and still default toTEAM.Fixed Issues
$ #93096
PROPOSAL: #93096 (comment)
Tests
Precondition: Expensifail account with
submit2026beta, Submit workspace.Offline tests
Same as Tests — the upgrade target is computed locally from the feature mapping, so the correct plan is chosen offline. The upgrade completes once back online.
QA Steps
Precondition: Expensifail account, Submit workspace on staging.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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
Android: Native
Screen.Recording.2026-09-04.at.12.28.33.AM.online-video-cutter.com.mp4
Android: mWeb Chrome
Record_2026-09-04-11-14-33.online-video-cutter.com.mp4
iOS: Native
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-09-04.at.00.23.35.online-video-cutter.com.mp4
iOS: mWeb Safari
Screen.Recording.2026-09-04.at.11.40.39.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-08-03.at.1.00.36.PM.online-video-cutter.com.mp4