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 2026-06-17] [$250] Upgrade opens after upgrading Submit WS via Prevent self-approvals, disabling & reenabling it #92864
Version Number: 9.4.0-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#91258 Email or phone of affected tester (no customers):applausetester+ssndjois2jd1@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Workspace Settings
Action Performed:
Precondition:
Log in with Expensifail account.
Create a Submit workspace on OD.
Go to staging.new.expensify.com
Go to workspace settings > Workflows.
Enable Prevent self-approvals.
Click Upgrade.
Close the RHP.
Disable and enable Prevent self-approvals.
Expected Result:
Upgrade page will not open after upgrading workspace via Prevent self-approvals, disabling and reenabling it.
Actual Result:
Upgrade page opens after upgrading workspace via Prevent self-approvals, disabling and reenabling it.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Please re-state the problem that we are trying to solve in this issue.
After upgrading a Submit workspace by enabling Prevent self-approvals, disabling and re-enabling that toggle re-opens the Upgrade page, even though the workspace was already upgraded.
What is the root cause of that problem?
The Prevent self-approvals toggle is a Control-tier rule. Its onToggle opens the Upgrade page whenever the policy is not a Control policy:
ExpenseReportRulesSection.tsx:56-62 — if (isEnabled && !isControlPolicy(policy)) { Navigation.navigate(...WORKSPACE_UPGRADE...preventSelfApproval...) }
When a Submit workspace upgrades through this flow, onUpgradeToCorporate only upgrades to Corporate (Control) for a hard-coded list of feature ids — otherwise it upgrades to Team (Collect):
preventSelfApproval (and the sibling rules-approval features autoApproveCompliantReports, autoPayApprovedReports) are not in that list, so the workspace is upgraded to Collect/Team, not Control. isControlPolicy(policy) is therefore still false afterward, so re-enabling the toggle re-triggers the Upgrade navigation. This is a regression from #91258.
What changes do you think we should make in order to solve the problem?
Add the three Control-tier rules-approval feature ids to the isCorporateUpgrade check in WorkspaceUpgradePage.tsx so the Submit→upgrade path targets CORPORATE for them:
This matches the toggles' own !isControlPolicy(policy) gating, so once upgraded the workspace is Control and the toggle no longer re-opens the Upgrade page. The same fix resolves the identical latent bug for Auto-approve compliant reports and Auto-pay approved reports, which share the gate at ExpenseReportRulesSection.tsx:80 and :128.
Alternative considered
Relaxing the toggle gate from !isControlPolicy(policy) to !isPaidGroupPolicy(policy) would also stop the re-prompt, but that would incorrectly make these Control-only rules available on Collect workspaces (and would diverge from the rules feature, which already upgrades to Corporate). Aligning the upgrade target with the existing Control requirement is the correct scope.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/92864) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Good call — there are more. The defect applies to every Control-tier feature whose toggle gates on !isControlPolicy(policy). Since the Submit→upgrade path defaults to TEAM (Collect) for anything not in the allowlist, any such feature stays !isControlPolicy after "upgrading" and re-loops.
Feature ids missing from isCorporateUpgrade
All verified to navigate to the upgrade page guarded by !isControlPolicy(policy):
approvals also gates on Control, but the Submit path short-circuits to approvalSubmit before reaching it (WorkspaceWorkflowsPage.tsx:269), so it's safe to omit today (optional, for future-proofing).
The Collect-tier features that correctly stay on TEAM are the ones in SUBMIT_FEATURE_IDS (companyCardSubmit, travelSubmit, approvalSubmit, roles, payments, accounting, expensifyCard, invoicing) — leave those as-is.
⚠️ Two gotchas
policyPreventMemberChangingTitle can't be fixed by the feature?.id check alone — WorkspaceUpgradePage.tsx:99 deliberately filters this id out, so feature is undefined here. The target-type decision must also key off featureNameAlias.
Separate (different) bug — feature is undefined, not in scope here but worth a follow-up: when a Submit owner picks the Control plan directly, no featureName is passed, so it falls into the undefined branch and upgrades to TEAM instead of Corporate — DynamicWorkspaceOverviewPlanTypePage.tsx:101 and SubscriptionPlanCardActionButton.tsx:86.
Recommendation: derive the tier instead of growing the allowlist
Needing 7+ new entries (and a special-case) is a sign the allowlist model is fragile — every future Control feature has to remember to amend onUpgradeToCorporate or silently reintroduce this loop. The guard dichotomy is clean across the whole codebase (Control features → !isControlPolicy; Collect/Submit features → SUBMIT_FEATURE_IDS/tryNavigateToSubmitWorkspaceUpgrade), and there's currently no tier metadata on the mapping entries.
Cleaner fix: add a requiredPlan: 'collect' | 'control' field to each UPGRADE_FEATURE_INTRO_MAPPING entry and derive targetType from it:
This makes the allowlist a one-liner, co-locates the tier with the feature definition, and handles policyPreventMemberChangingTitle naturally (read requiredPlan off the raw mapping even though feature is filtered for the intro UI).
Reachability caveat
reportFields, glCodes, glAndPayrollCodes, taxCodes, and multiLevelTags each require a prerequisite feature (accounting connection / tags / taxes / categories) to be enabled first, so I couldn't fully confirm a raw Submit workspace reaches every one without first upgrading via another path. They still all share the defect and should be covered. multiApprovalLevels, auditor, reportFields-toggle, and policyPreventMemberChangingTitle are directly reachable from a Submit workspace. A VictoriaLogs query for upgrade-page navigations from type === 'submit' policies grouped by featureName would confirm real-world impact per feature.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/92864) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-][$250] Upgrade opens after upgrading Submit WS via Prevent self-approvals, disabling & reenabling it[/-][+][Due for payment 2026-06-17] [$250] Upgrade opens after upgrading Submit WS via Prevent self-approvals, disabling & reenabling it[/+]on Jun 10, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.1-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@hungvu193 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]. If no checklist is needed for this issue, you can click: [no checklist button]
Melvin's audit on #92864 also called out reportFields as having the same bug, but it didn't get requiredPlan in that PR. Was that on purpose? Is Report Fields meant to stay Collect-tier on Submit workspaces?
Trying to figure out if #93096 should add requiredPlan: CORPORATE on the mapping, or fix the Reports page navigation instead. Any context would help, thanks!
Activity
applause-bot commentedon Jun 6, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/64deb3495d471e76616d60c2a855e5802951fbaced82ba146649a5a92f1dd18c
melvin-bot commentedon Jun 6, 2026
@iwiznia recently merged #91258, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon Jun 6, 2026
Triggered auto assignment to @JS00001 (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Jun 6, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 6, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
MelvinBot commentedon Jun 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After upgrading a Submit workspace by enabling Prevent self-approvals, disabling and re-enabling that toggle re-opens the Upgrade page, even though the workspace was already upgraded.
What is the root cause of that problem?
The Prevent self-approvals toggle is a Control-tier rule. Its
onToggleopens the Upgrade page whenever the policy is not a Control policy:When a Submit workspace upgrades through this flow,
onUpgradeToCorporateonly upgrades to Corporate (Control) for a hard-coded list of feature ids — otherwise it upgrades to Team (Collect):preventSelfApproval(and the sibling rules-approval featuresautoApproveCompliantReports,autoPayApprovedReports) are not in that list, so the workspace is upgraded to Collect/Team, not Control.isControlPolicy(policy)is therefore stillfalseafterward, so re-enabling the toggle re-triggers the Upgrade navigation. This is a regression from #91258.What changes do you think we should make in order to solve the problem?
Add the three Control-tier rules-approval feature ids to the
isCorporateUpgradecheck inWorkspaceUpgradePage.tsxso the Submit→upgrade path targetsCORPORATEfor them:This matches the toggles' own
!isControlPolicy(policy)gating, so once upgraded the workspace is Control and the toggle no longer re-opens the Upgrade page. The same fix resolves the identical latent bug for Auto-approve compliant reports and Auto-pay approved reports, which share the gate atExpenseReportRulesSection.tsx:80and:128.Alternative considered
Relaxing the toggle gate from
!isControlPolicy(policy)to!isPaidGroupPolicy(policy)would also stop the re-prompt, but that would incorrectly make these Control-only rules available on Collect workspaces (and would diverge from therulesfeature, which already upgrades to Corporate). Aligning the upgrade target with the existing Control requirement is the correct scope.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/92864)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
hungvu193 commentedon Jun 7, 2026
Taking a look 👀
hungvu193 commentedon Jun 7, 2026
@MelvinBot Good point in this proposal, let's check if there is any other feature that we also need to add in
isCorporateUpgradecheck.MelvinBot commentedon Jun 7, 2026
Good call — there are more. The defect applies to every Control-tier feature whose toggle gates on
!isControlPolicy(policy). Since the Submit→upgrade path defaults to TEAM (Collect) for anything not in the allowlist, any such feature stays!isControlPolicyafter "upgrading" and re-loops.Feature ids missing from
isCorporateUpgradeAll verified to navigate to the upgrade page guarded by
!isControlPolicy(policy):multiApprovalLevelsDynamicReportChangeApproverPage.tsx:70,SearchChangeApproverPage.tsx:146auditorImportedMembersPage.tsx:103reportFieldsWorkspaceReportsPage.tsx:313(+ QBO/Xero report-field mapping pages, same id viagetFeatureNameAlias)glAndPayrollCodesCategorySettingsPage.tsx:308glCodesTagSettingsPage.tsx:106taxCodesWorkspaceEditTaxPage.tsx:168multiLevelTagsImportTagsOptionsPage.tsx:279policyPreventMemberChangingTitleWorkspaceReportsPage.tsx:266—approvalsalso gates on Control, but the Submit path short-circuits toapprovalSubmitbefore reaching it (WorkspaceWorkflowsPage.tsx:269), so it's safe to omit today (optional, for future-proofing).The Collect-tier features that correctly stay on TEAM are the ones in
SUBMIT_FEATURE_IDS(companyCardSubmit, travelSubmit, approvalSubmit, roles, payments, accounting, expensifyCard, invoicing) — leave those as-is.policyPreventMemberChangingTitlecan't be fixed by thefeature?.idcheck alone —WorkspaceUpgradePage.tsx:99deliberately filters this id out, sofeatureisundefinedhere. The target-type decision must also key offfeatureNameAlias.featureisundefined, not in scope here but worth a follow-up: when a Submit owner picks the Control plan directly, nofeatureNameis passed, so it falls into theundefinedbranch and upgrades to TEAM instead of Corporate —DynamicWorkspaceOverviewPlanTypePage.tsx:101andSubscriptionPlanCardActionButton.tsx:86.Recommendation: derive the tier instead of growing the allowlist
Needing 7+ new entries (and a special-case) is a sign the allowlist model is fragile — every future Control feature has to remember to amend
onUpgradeToCorporateor silently reintroduce this loop. The guard dichotomy is clean across the whole codebase (Control features →!isControlPolicy; Collect/Submit features →SUBMIT_FEATURE_IDS/tryNavigateToSubmitWorkspaceUpgrade), and there's currently no tier metadata on the mapping entries.Cleaner fix: add a
requiredPlan: 'collect' | 'control'field to eachUPGRADE_FEATURE_INTRO_MAPPINGentry and derivetargetTypefrom it:This makes the allowlist a one-liner, co-locates the tier with the feature definition, and handles
policyPreventMemberChangingTitlenaturally (readrequiredPlanoff the raw mapping even thoughfeatureis filtered for the intro UI).Reachability caveat
reportFields,glCodes,glAndPayrollCodes,taxCodes, andmultiLevelTagseach require a prerequisite feature (accounting connection / tags / taxes / categories) to be enabled first, so I couldn't fully confirm a raw Submit workspace reaches every one without first upgrading via another path. They still all share the defect and should be covered.multiApprovalLevels,auditor,reportFields-toggle, andpolicyPreventMemberChangingTitleare directly reachable from a Submit workspace. A VictoriaLogs query for upgrade-page navigations fromtype === 'submit'policies grouped byfeatureNamewould confirm real-world impact per feature.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/92864)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
17 remaining items
iwiznia commentedon Jun 8, 2026
Not a blocker since this is under beta
[-][$250] Upgrade opens after upgrading Submit WS via Prevent self-approvals, disabling & reenabling it[/-][+][Due for payment 2026-06-17] [$250] Upgrade opens after upgrading Submit WS via Prevent self-approvals, disabling & reenabling it[/+]melvin-bot commentedon Jun 10, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 10, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.1-6 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 2026-06-17. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 10, 2026
@hungvu193 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]. If no checklist is needed for this issue, you can click: [no checklist button]
melvin-bot commentedon Jun 11, 2026
@hungvu193 Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Jun 15, 2026
@hungvu193 Still overdue 6 days?! Let's take care of this!
hungvu193 commentedon Jun 17, 2026
We can close
neerajbachani commentedon Aug 11, 2026
@hungvu193 You worked on the
requiredPlanchange in #92872,quick question.
Melvin's audit on #92864 also called out
reportFieldsas having the same bug, but it didn't getrequiredPlanin that PR. Was that on purpose? Is Report Fields meant to stay Collect-tier on Submit workspaces?Trying to figure out if #93096 should add
requiredPlan: CORPORATEon the mapping, or fix the Reports page navigation instead. Any context would help, thanks!