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
The "Getting started" section disappears from Home before all to-dos are complete #94773
Version Number: v9.4.21-2 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:#94047 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 / Chrome, Android 13 / Xiaomi Poco F5 App Component: Other
Sign up a new account and select the onboarding intent is Manage my team's expenses
Complete the onboarding flow
Complete the Customize accounting categories by editing any Category name
Verify that the Customize accounting categories is checked and the new to-do Set up spend rules appears
Complete the Link company cards by adding a company card
Back to Home section
Expected Result:
Verify the Getting started section disappears from Home once all to-dos are complete
Actual Result:
The "Getting started" section disappears from Home before all to-dos are complete.
Note:
The to-do Set up spend rule is still not completed
👋 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.
Deploy-blocker recommendation: the fastest safe unblock is to revert Expensify/App#94047 (the PR that introduced this), which restores the prior behavior where the section stays for the Getting Started window. The hide logic can then be re-landed with the fix below.
What is the root cause of that problem?
PR #94047 added a buildResult helper that hides the entireGetting started section as soon as every item currently in the list is complete:
So when areRulesEnabled is false/not-yet-loaded for a given render — which happens transiently while the policy is being merged/refetched (e.g. right after completing Link company cards) — the setupRules item is absent from the array. The remaining items (createWorkspace, customizeCategories, linkCompanyCards) are then all complete, items.every(isComplete) returns true, and the whole section collapses, even though the user still has an outstanding "Set up spend rules" to-do. That matches the report exactly: the section vanishes while Set up spend rule is still incomplete.
Investigation details & a second contributing factor
Why the item disappears:areRulesEnabled is only written by enablePolicyRules / the Control upgrade flow — not by completing categories or company cards (verified: enablePolicyCategories and enableCompanyCards never touch it). In the repro, the to-do appeared after the category edit (rules got enabled by a separate/optimistic update), but a subsequent policy merge (adding the company card) can land a render where areRulesEnabled is momentarily false, dropping setupRules from the list and triggering the premature every() hide.
Second, independent flaw in the completion check: even when setupRulesis present, its isComplete uses hasConfiguredRules(policy), which returns true on auto-enabled fields the user never configured — notably policy.eReceipts (auto-set to true for Control + USD workspaces when rules are enabled) and requireCompanyCardsEnabled. On such a workspace the "Set up spend rules" to-do can auto-complete with zero user action, also collapsing the section prematurely. Whichever path fires first, the result is the same.
Alternative explanations ruled out: a logic bug where setupRules is present and incomplete would keep the section visible (every → false) — that path is correct. The bug only manifests when the item is either absent (race) or auto-completed (hasConfiguredRules).
What changes do you think we should make in order to solve the problem?
Don't derive "all to-dos done" from a list whose membership depends on async/optimistic policy flags. Concretely:
Build the full, stable set of to-dos for the intent before evaluating completeness — i.e. always include the setupRules to-do for the rules-eligible intents rather than gating its existence on the live areRulesEnabled flag, and/or guard buildResult so it doesn't hide while required policy data (policy, card feeds, rules flag) is still loading.
Fix hasConfiguredRules (or use a narrower check for this to-do) so the "Set up spend rules" item is only considered complete when the user has actually configured a rule — not when eReceipts/requireCompanyCardsEnabled were auto-enabled by the Control upgrade.
What alternative solutions did you explore? (Optional)
Revert #94047 to immediately unblock the deploy (recommended for the deploy-blocker), then re-land with the guard above plus a unit test covering: areRulesEnabled toggling false→true across renders, and a Control+USD workspace where eReceipts is auto-set.
Confidence: Medium — the buildResult design flaw and the hasConfiguredRules over-matching are confirmed in code; the exact production render ordering of areRulesEnabled (which involves a Web-Expensify policy response outside this repo) would be worth confirming from logs but doesn't change the App-side fix.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/94773) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
I now have all the information needed from the PR diff. Here's the complete, ready-to-post proposal:
Proposal
Root Cause
PR #94047 introduced a buildResult() function in src/pages/home/GettingStartedSection/hooks/useGettingStartedItems.ts that hides the "Getting started" section when builtItems.every((item) => item.isComplete) is true. The bug is that the "Set up spend rules" to-do is conditionally appended to the items array — it only appears after the user completes "Customize accounting categories."
This creates a race condition in the completeness check: when the user completes the company cards step (which is the last initially-visible to-do), buildResult() evaluates the items array before the spend rules to-do has been appended. At that point, all items in the array are complete, so every() returns true and the section disappears — even though the spend rules to-do hasn't been added to the list yet and is therefore never shown as incomplete to the evaluator.
In summary: buildResult() only sees and evaluates the items that have already been built by the time it is called. If a dynamically-appended to-do (spend rules) hasn't been pushed into items yet during that render cycle, it is invisible to the .every() check.
Fix
The fix is to ensure the "Set up spend rules" item is included in the items array before buildResult() is called, regardless of whether it is conditionally shown or not. Specifically, in the MANAGE_TEAM code path, the spend rules item should be pushed into items as long as the feature flag that makes it available is active — even if it hasn't yet been "unlocked" for display. Its isComplete value should accurately reflect whether it has been completed.
Concretely, in useGettingStartedItems.ts, the spend rules item should not be gated behind a condition that causes it to be skipped entirely before buildResult() runs. Instead:
Always include the spend rules GettingStartedItem in the items array when the MANAGE_TEAM (or TRACK_WORKSPACE) intent is active and the item is relevant.
Set isComplete: false until the rules are actually set up by the user.
The existing display logic that shows/hides the item in the UI can remain in place — this change only affects whether the item participates in the every() completeness check.
This ensures that buildResult() considers all relevant to-dos when deciding whether to hide the section, not just the ones that happened to be pushed into the array before the last visible step was completed.
Files to change
src/pages/home/GettingStartedSection/hooks/useGettingStartedItems.ts — adjust the MANAGE_TEAM branch so the spend rules GettingStartedItem is included in items before buildResult(items) is called.
tests/unit/hooks/useGettingStartedItems.test.ts — add a test case: "should stay visible when categories are complete and company cards are linked but spend rules are not yet set up", covering the exact sequence from the bug report.
Deploy-blocker recommendation: the fastest safe unblock is to revert Expensify/App#94047 (the PR that introduced this), which restores the prior behavior where the section stays for the Getting Started window. The hide logic can then be re-landed with the fix below.
What is the root cause of that problem?
PR #94047 added a buildResult helper that hides the entireGetting started section as soon as every item currently in the list is complete:
So when areRulesEnabled is false/not-yet-loaded for a given render — which happens transiently while the policy is being merged/refetched (e.g. right after completing Link company cards) — the setupRules item is absent from the array. The remaining items (createWorkspace, customizeCategories, linkCompanyCards) are then all complete, items.every(isComplete) returns true, and the whole section collapses, even though the user still has an outstanding "Set up spend rules" to-do. That matches the report exactly: the section vanishes while Set up spend rule is still incomplete.
Investigation details & a second contributing factor Why the item disappears:areRulesEnabled is only written by enablePolicyRules / the Control upgrade flow — not by completing categories or company cards (verified: enablePolicyCategories and enableCompanyCards never touch it). In the repro, the to-do appeared after the category edit (rules got enabled by a separate/optimistic update), but a subsequent policy merge (adding the company card) can land a render where areRulesEnabled is momentarily false, dropping setupRules from the list and triggering the premature every() hide.
Second, independent flaw in the completion check: even when setupRulesis present, its isComplete uses hasConfiguredRules(policy), which returns true on auto-enabled fields the user never configured — notably policy.eReceipts (auto-set to true for Control + USD workspaces when rules are enabled) and requireCompanyCardsEnabled. On such a workspace the "Set up spend rules" to-do can auto-complete with zero user action, also collapsing the section prematurely. Whichever path fires first, the result is the same.
Alternative explanations ruled out: a logic bug where setupRules is present and incomplete would keep the section visible (every → false) — that path is correct. The bug only manifests when the item is either absent (race) or auto-completed (hasConfiguredRules).
What changes do you think we should make in order to solve the problem?
Don't derive "all to-dos done" from a list whose membership depends on async/optimistic policy flags. Concretely:
Build the full, stable set of to-dos for the intent before evaluating completeness — i.e. always include the setupRules to-do for the rules-eligible intents rather than gating its existence on the live areRulesEnabled flag, and/or guard buildResult so it doesn't hide while required policy data (policy, card feeds, rules flag) is still loading.
Fix hasConfiguredRules (or use a narrower check for this to-do) so the "Set up spend rules" item is only considered complete when the user has actually configured a rule — not when eReceipts/requireCompanyCardsEnabled were auto-enabled by the Control upgrade.
What alternative solutions did you explore? (Optional)
Revert #94047 to immediately unblock the deploy (recommended for the deploy-blocker), then re-land with the guard above plus a unit test covering: areRulesEnabled toggling false→true across renders, and a Control+USD workspace where eReceipts is auto-set.
Confidence: Medium — the buildResult design flaw and the hasConfiguredRules over-matching are confirmed in code; the exact production render ordering of areRulesEnabled (which involves a Web-Expensify policy response outside this repo) would be worth confirming from logs but doesn't change the App-side fix.
Next Steps for Contributor+ team:To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/94773) to create a draft PR. To refine:@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
It's not regression from this PR
After validating account to get access for creating cards, rules for some reason are disabled (As a result, they are no longer taken into account in the getting stated checkboxes)
But we didn't change anything in this logic
@MelvinBot would it fix it pass isBetaEnabled(CONST.BETAS.RULES_REVAMP) into arePolicyRulesEnabled at useGettingStartedItems.ts:282, matching WorkspaceMoreFeaturesPage?
Why it's still worth doing: MANAGE_TEAM onboarding creates a Team/Collect workspace unless a Control-only feature or integration was picked (Policy.ts:2783, via useCompleteOnboarding.ts:79). So today, on a Collect workspace with areRulesEnabled: true and the beta on, WorkspaceMoreFeaturesPage:537 shows Rules as active while useGettingStartedItems.ts:282 silently drops the "Set up spend rules" to-do — and once it's dropped, buildResult sees every remaining item complete and hides the section. That's exactly the reported symptom, so this is a genuine bug independent of the original report. getWorkspaceMenuItems.ts:175 and useControlOnlyRuleUpgradeRedirect.ts:33 already pass the beta; this hook is the outlier. It's a one-line change — the call is in the hook body, so usePermissions() is available there.
Why it may not close the issue:ZhenjaHorbach's repro was rules getting disabled after account validation. If the backend is sending areRulesEnabled: false, path 2 fires and the beta arg changes nothing — the to-do still disappears and the section still hides.
Suggested scope: make the one-line change for consistency, and also stop buildResult from hiding the section purely because a policy-flag-gated item left the list (or keep the to-do in the list whenever the intent is rules-eligible). That covers both paths.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
Activity
applause-bot commentedon Jun 27, 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/8c6bb12bac5a890c2dc8b289af2e95ff12c7a7d46f93b23d8ee71f20da302f89
melvin-bot commentedon Jun 27, 2026
@grgia recently merged #94047, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon Jun 27, 2026
Triggered auto assignment to @stitesExpensify (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Jun 27, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 27, 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 27, 2026
Proposal
What is the root cause of that problem?
PR #94047 added a
buildResulthelper that hides the entireGetting startedsection as soon as every item currently in the list is complete:useGettingStartedItems.ts:65-70The problem is that the
Set up spend rulesto-do is conditional — it's only pushed into the list whenpolicy.areRulesEnabledis true:useGettingStartedItems.ts:156-163So when
areRulesEnabledisfalse/not-yet-loaded for a given render — which happens transiently while the policy is being merged/refetched (e.g. right after completing Link company cards) — thesetupRulesitem is absent from the array. The remaining items (createWorkspace,customizeCategories,linkCompanyCards) are then all complete,items.every(isComplete)returnstrue, and the whole section collapses, even though the user still has an outstanding "Set up spend rules" to-do. That matches the report exactly: the section vanishes while Set up spend rule is still incomplete.Investigation details & a second contributing factor
Why the item disappears:
areRulesEnabledis only written byenablePolicyRules/ the Control upgrade flow — not by completing categories or company cards (verified:enablePolicyCategoriesandenableCompanyCardsnever touch it). In the repro, the to-do appeared after the category edit (rules got enabled by a separate/optimistic update), but a subsequent policy merge (adding the company card) can land a render whereareRulesEnabledis momentarilyfalse, droppingsetupRulesfrom the list and triggering the prematureevery()hide.Second, independent flaw in the completion check: even when
setupRulesis present, itsisCompleteuseshasConfiguredRules(policy), which returnstrueon auto-enabled fields the user never configured — notablypolicy.eReceipts(auto-set totruefor Control + USD workspaces when rules are enabled) andrequireCompanyCardsEnabled. On such a workspace the "Set up spend rules" to-do can auto-complete with zero user action, also collapsing the section prematurely. Whichever path fires first, the result is the same.Alternative explanations ruled out: a logic bug where
setupRulesis present and incomplete would keep the section visible (every→ false) — that path is correct. The bug only manifests when the item is either absent (race) or auto-completed (hasConfiguredRules).What changes do you think we should make in order to solve the problem?
Don't derive "all to-dos done" from a list whose membership depends on async/optimistic policy flags. Concretely:
setupRulesto-do for the rules-eligible intents rather than gating its existence on the liveareRulesEnabledflag, and/or guardbuildResultso it doesn't hide while required policy data (policy, card feeds, rules flag) is still loading.hasConfiguredRules(or use a narrower check for this to-do) so the "Set up spend rules" item is only considered complete when the user has actually configured a rule — not wheneReceipts/requireCompanyCardsEnabledwere auto-enabled by the Control upgrade.What alternative solutions did you explore? (Optional)
Revert #94047 to immediately unblock the deploy (recommended for the deploy-blocker), then re-land with the guard above plus a unit test covering:
areRulesEnabledtoggling false→true across renders, and a Control+USD workspace whereeReceiptsis auto-set.Confidence: Medium — the
buildResultdesign flaw and thehasConfiguredRulesover-matching are confirmed in code; the exact production render ordering ofareRulesEnabled(which involves a Web-Expensify policy response outside this repo) would be worth confirming from logs but doesn't change the App-side fix.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/94773)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
Ayesha-Ashraf-Dev commentedon Jun 27, 2026
Contributor details
Your Expensify account email: ayeshaashraf0091@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/ayeshaa337
I now have all the information needed from the PR diff. Here's the complete, ready-to-post proposal:
Proposal
Root Cause
PR #94047 introduced a buildResult() function in src/pages/home/GettingStartedSection/hooks/useGettingStartedItems.ts that hides the "Getting started" section when builtItems.every((item) => item.isComplete) is true. The bug is that the "Set up spend rules" to-do is conditionally appended to the items array — it only appears after the user completes "Customize accounting categories."
This creates a race condition in the completeness check: when the user completes the company cards step (which is the last initially-visible to-do), buildResult() evaluates the items array before the spend rules to-do has been appended. At that point, all items in the array are complete, so every() returns true and the section disappears — even though the spend rules to-do hasn't been added to the list yet and is therefore never shown as incomplete to the evaluator.
In summary: buildResult() only sees and evaluates the items that have already been built by the time it is called. If a dynamically-appended to-do (spend rules) hasn't been pushed into items yet during that render cycle, it is invisible to the .every() check.
Fix
The fix is to ensure the "Set up spend rules" item is included in the items array before buildResult() is called, regardless of whether it is conditionally shown or not. Specifically, in the MANAGE_TEAM code path, the spend rules item should be pushed into items as long as the feature flag that makes it available is active — even if it hasn't yet been "unlocked" for display. Its isComplete value should accurately reflect whether it has been completed.
Concretely, in useGettingStartedItems.ts, the spend rules item should not be gated behind a condition that causes it to be skipped entirely before buildResult() runs. Instead:
Always include the spend rules GettingStartedItem in the items array when the MANAGE_TEAM (or TRACK_WORKSPACE) intent is active and the item is relevant.
Set isComplete: false until the rules are actually set up by the user.
The existing display logic that shows/hides the item in the UI can remain in place — this change only affects whether the item participates in the every() completeness check.
This ensures that buildResult() considers all relevant to-dos when deciding whether to hide the section, not just the ones that happened to be pushed into the array before the last visible step was completed.
Files to change
src/pages/home/GettingStartedSection/hooks/useGettingStartedItems.ts — adjust the MANAGE_TEAM branch so the spend rules GettingStartedItem is included in items before buildResult(items) is called.
tests/unit/hooks/useGettingStartedItems.test.ts — add a test case: "should stay visible when categories are complete and company cards are linked but spend rules are not yet set up", covering the exact sequence from the bug report.
melvin-bot commentedon Jun 27, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
ZhenjaHorbach commentedon Jun 27, 2026
It's not regression from this PR
After validating account to get access for creating cards, rules for some reason are disabled (As a result, they are no longer taken into account in the getting stated checkboxes)
But we didn't change anything in this logic
2026-06-27.13.30.30.mov
And in prod we have a similar behaviour
2026-06-27.13.40.59.mov
33 remaining items
grgia commentedon Sep 2, 2026
@MelvinBot would it fix it pass
isBetaEnabled(CONST.BETAS.RULES_REVAMP)intoarePolicyRulesEnabledatuseGettingStartedItems.ts:282, matchingWorkspaceMoreFeaturesPage?MelvinBot commentedon Sep 2, 2026
Partly — it fixes a real divergence, but only for Collect workspaces, and only when the beta is on.
arePolicyRulesEnabledhas two independent ways to returnfalse(PolicyUtils.ts:1691-1709):isCollectPolicy(policy) && !isRulesRevampEnabled. This is the one your change addresses.policy.areRulesEnabled === false, checked after the gate, so the beta arg can't override it.Why it's still worth doing: MANAGE_TEAM onboarding creates a Team/Collect workspace unless a Control-only feature or integration was picked (
Policy.ts:2783, viauseCompleteOnboarding.ts:79). So today, on a Collect workspace withareRulesEnabled: trueand the beta on,WorkspaceMoreFeaturesPage:537shows Rules as active whileuseGettingStartedItems.ts:282silently drops the "Set up spend rules" to-do — and once it's dropped,buildResultsees every remaining item complete and hides the section. That's exactly the reported symptom, so this is a genuine bug independent of the original report.getWorkspaceMenuItems.ts:175anduseControlOnlyRuleUpgradeRedirect.ts:33already pass the beta; this hook is the outlier. It's a one-line change — the call is in the hook body, sousePermissions()is available there.Why it may not close the issue:
ZhenjaHorbach's repro was rules getting disabled after account validation. If the backend is sendingareRulesEnabled: false, path 2 fires and the beta arg changes nothing — the to-do still disappears and the section still hides.Suggested scope: make the one-line change for consistency, and also stop
buildResultfrom hiding the section purely because a policy-flag-gated item left the list (or keep the to-do in the list whenever the intent is rules-eligible). That covers both paths.view run · view recording
melvin-bot commentedon Sep 3, 2026
@ZhenjaHorbach Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
melvin-bot commentedon Sep 4, 2026
@ZhenjaHorbach Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
melvin-bot commentedon Sep 4, 2026
@ZhenjaHorbach Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
melvin-bot commentedon Sep 7, 2026
@ZhenjaHorbach 12 days overdue now... This issue's end is nigh!
melvin-bot commentedon Sep 10, 2026
This issue has not been updated in over 14 days. @grgia, @adamgrzybowski, @ZhenjaHorbach eroding to Weekly issue.
melvin-bot commentedon Oct 5, 2026
This issue has not been updated in over 15 days. @grgia, @adamgrzybowski, @ZhenjaHorbach eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!