Skip to content

web - AI promo modal - Promo model not displayed until page refresh #93974

Closed

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: 9.4.15-1
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: #92007
Email or phone of affected tester (no customers): vbfgrt56des@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Win 11/Chrome
App Component: Other

Action Performed:

Precondition: clear the browser cache and do a hard refresh or try in incognito

  1. Go to staging.new.expensify.com
  2. Log in with a new account.
  3. Complete onboarding (Onboard as Manage my team, 1-4, QBO).
  4. Navigate to Home

Expected Result:

Ai promo model displayed

Actual Result:

Ai promo model displayed only after page refresh

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7184858_1781805456178.Recording__3046.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Nathan Lemma
Bug ID: 7184858

Issue OwnerCurrent Issue Owner: @gijoe0295

Activity

  1. applause-bot commented on Jun 18, 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/2ec7e88ebcd40c43b6980991714c377b6e836d16da8a26cd46baa112bc9e912a

  2. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 18, 2026
  3. melvin-bot commented on Jun 18, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #92007

  4. melvin-bot commented on Jun 18, 2026

    @melvin-bot

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

  5. github-actions commented on Jun 18, 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.
  6. MelvinBot commented on Jun 18, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The AI promo modal is gated by a session-long suppression flag, observedActiveOnboardingThisSession, introduced in AIFeaturesPromoGuard.ts (PR #92007). It is a write-once latch: it is only ever set to true, never reset within a session. For a brand-new user it trips immediately during onboarding — before they finish — so the modal stays suppressed for the rest of the session. A hard refresh re-initializes the module (flag back to false) and, since onboarding is now complete, nothing re-trips it, so the modal finally appears.

    Both code paths trip the flag during the "Manage my team" flow because the server seeds NVP_ONBOARDING.hasCompletedGuidedSetupFlow = false for new users:

    • Onyx path — AIFeaturesPromoGuard.ts:156-157: when hasCompletedGuidedSetupFlowSelector(onboarding) === false, it latches observedActiveOnboardingThisSession = true. When onboarding completes (ReportUtils.ts:11999 merges hasCompletedGuidedSetupFlow: true), the === false branch is simply skipped — the flag is never cleared.
    • Navigation-state path — AIFeaturesPromoGuard.ts:57-58: latches the same flag whenever ONBOARDING_MODAL_NAVIGATOR is in the nav tree, which it is throughout onboarding (AuthScreens.tsx:331-342).

    Once latched, isEligibleToShowAIFeaturesPromoModal() (which requires !observedActiveOnboardingThisSession) returns false for the rest of the session.

    Evidence / data flow
    1. New user boots → server seeds NVP_ONBOARDING.hasCompletedGuidedSetupFlow = false (the field is required: Onboarding.ts:10; selector returns the explicit value at Onboarding.ts:23). useOnboardingFlow relies on the same === false to even launch onboarding (useOnboardingFlow.ts:46).
    2. Both the Onyx callback and the nav-state listener latch observedActiveOnboardingThisSession = true — during onboarding, before completion.
    3. User completes onboarding → hasCompletedGuidedSetupFlow flips to true, onboarding navigator unmounts. The latch is never reset.
    4. Lands on Home → eligibility check returns false → modal not shown.
    5. Hard refresh → module re-initializes (latch false), onboarding already complete so neither path re-trips → modal shows.

    The flag is grep-confirmed to only ever be assigned true (lines 58 and 157) and never reset within a session.

    What changes do you think we should make in order to solve the problem?

    Stop treating observedActiveOnboardingThisSession as a one-way latch and instead evaluate the onboarding-active condition live at eligibility-check time, so completing onboarding re-opens the gate:

    • In the NVP_ONBOARDING callback, re-derive the flag every time instead of only ever setting true — i.e. set it to hasCompletedGuidedSetupFlowSelector(onboarding) === false so it flips back to false once onboarding completes.
    • Have the nav-state listener reflect the current presence of ONBOARDING_MODAL_NAVIGATOR rather than latching, so it clears once the navigator unmounts.

    The "don't stack the promo on top of an active onboarding/migration modal" guarantee is preserved because the modal is only navigated to after Navigation.waitForProtectedRoutes() and TransitionTracker.runAfterTransitions settle — i.e. only once onboarding is dismissed and Home has rendered.

    ⚠️ Note: the guard's own comment says the promo "must not appear in the same session as ... the onboarding flow." That intent directly conflicts with this issue's expected behavior (show right after onboarding completes). Please confirm the intended product behavior before implementing — if same-session suppression was deliberate, the fix is instead to relax that requirement for the onboarding case specifically.

    What alternative solutions did you explore? (Optional)

    None — the root cause is a single sticky flag with two redundant trip points.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/93974) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  7. IuliiaHerets commented on Jun 18, 2026

    @IuliiaHerets

    Chrome / v9.4.15-2
    no AI modal

    bandicam.2026-06-19.00-42-02-079.mp4
  8. gijoe0295 commented on Jun 19, 2026

    @gijoe0295
    Contributor

    This is expected. Promo modal is expected not to appear in the same session as onboarding/migrated user modals. It should appear the next time user opens App. I'll add it to Tests section in second attempt so QA team is aware of.

  9. danielrvidal commented on Jun 22, 2026

    @danielrvidal
    Contributor

    @gijoe0295 I was signing out and then back in though and then still not seeing it until there was a hard refresh. That is not expected right? Do you mind confirming that is not happening still

  10. gijoe0295 commented on Jun 25, 2026

    @gijoe0295
    Contributor

    @gijoe0295 I was signing out and then back in though and then still not seeing it until there was a hard refresh. That is not expected right? Do you mind confirming that is not happening still

    Yes my implementation is that the modal would show the next time user closes and reopens app. Signing out and back then still belongs to the same app opening so it won't show.

  11. danielrvidal commented on Jun 29, 2026

    @danielrvidal
    Contributor

    Aw, got it. Thank you!

  12. melvin-bot commented on Jul 2, 2026

    @melvin-bot

    @gijoe0295 this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  13. gijoe0295 commented on Jul 3, 2026

    @gijoe0295
    Contributor

    @danielrvidal Can you close this?

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

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringHourlyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions