Skip to content

The "Getting started" section disappears from Home before all to-dos are complete #94773

Open

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Sign up a new account and select the onboarding intent is Manage my team's expenses
  3. Complete the onboarding flow
  4. 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
  5. Complete the Link company cards by adding a company card
  6. 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

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7192780_1782556029035.94730_-_PR94047_-_The_Getting_started_section_disappears_from_Home_before_all_to-dos_are_complete.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7192780

Issue OwnerCurrent Issue Owner: @ZhenjaHorbach

Activity

  1. applause-bot commented on Jun 27, 2026

    @applause-bot
    Author

    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

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 27, 2026
  3. melvin-bot commented on Jun 27, 2026

    @melvin-bot

    @grgia recently merged #94047, but they are OOO right now, so I'll auto-assign someone else.

  4. melvin-bot commented on Jun 27, 2026

    @melvin-bot

    Triggered auto assignment to @stitesExpensify (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  5. melvin-bot commented on Jun 27, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  6. github-actions commented on Jun 27, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  7. MelvinBot commented on Jun 27, 2026

    @MelvinBot
    Contributor

    Proposal

    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 entire Getting started section as soon as every item currently in the list is complete:

    useGettingStartedItems.ts:65-70

    The problem is that the Set up spend rules to-do is conditional — it's only pushed into the list when policy.areRulesEnabled is true:

    useGettingStartedItems.ts:156-163

    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 setupRules is 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:

    1. 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.
    2. 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.

  8. Ayesha-Ashraf-Dev commented on Jun 27, 2026

    @Ayesha-Ashraf-Dev

    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.

  9. melvin-bot commented on Jun 27, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  10. ZhenjaHorbach commented on Jun 27, 2026

    @ZhenjaHorbach
    Contributor

    Proposal

    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 entire Getting started section as soon as every item currently in the list is complete:

    useGettingStartedItems.ts:65-70

    The problem is that the Set up spend rules to-do is conditional — it's only pushed into the list when policy.areRulesEnabled is true:

    useGettingStartedItems.ts:156-163

    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 setupRules is 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:

    1. 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.
    2. 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

    2026-06-27.13.30.30.mov

    And in prod we have a similar behaviour

    2026-06-27.13.40.59.mov
  11. 33 remaining items

  12. grgia commented on Sep 2, 2026

    @grgia
    Contributor

    @MelvinBot would it fix it pass isBetaEnabled(CONST.BETAS.RULES_REVAMP) into arePolicyRulesEnabled at useGettingStartedItems.ts:282, matching WorkspaceMoreFeaturesPage?

  13. MelvinBot commented on Sep 2, 2026

    @MelvinBot
    Contributor

    Partly — it fixes a real divergence, but only for Collect workspaces, and only when the beta is on.

    arePolicyRulesEnabled has two independent ways to return false (PolicyUtils.ts:1691-1709):

    1. The Collect gate — isCollectPolicy(policy) && !isRulesRevampEnabled. This is the one your change addresses.
    2. The explicit flag — 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, 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.


    view run · view recording

  14. melvin-bot commented on Sep 3, 2026

    @melvin-bot

    @ZhenjaHorbach Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  15. melvin-bot commented on Sep 4, 2026

    @melvin-bot

    @ZhenjaHorbach Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  16. melvin-bot commented on Sep 4, 2026

    @melvin-bot

    @ZhenjaHorbach Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  17. melvin-bot commented on Sep 7, 2026

    @melvin-bot

    @ZhenjaHorbach 12 days overdue now... This issue's end is nigh!

  18. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    This issue has not been updated in over 14 days. @grgia, @adamgrzybowski, @ZhenjaHorbach eroding to Weekly issue.

  19. melvin-bot commented on Oct 5, 2026

    @melvin-bot

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringMonthlyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions