Skip to content

Reports - Dismissed tooltip reappears after reset app or relogin #84168

Closed

Description

@lanitochka17

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.3.31-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: #82982
Email or phone of affected tester (no customers): josidjnosidjoidjiosj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Reports > Expenses.
  3. Click Filters.
  4. Click Has.
  5. Click X button on the tooltip to dismiss it.
  6. Close the RHP.
  7. Go to Account > Troubleshoot > Clear cache and restart > Reset and refresh OR relogin.
  8. Go to Reports > Expenses.
  9. Click Filters.
  10. Click Has.

Expected Result:

Tooltip will no longer appear after reset app or relogin because user has manually dismissed it in Step 5.

Actual Result:

Dismissed tooltip reappears after reset app or relogin.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7093933_1772649227749.2.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @puneetlath

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    on Mar 4, 2026
  2. melvin-bot commented on Mar 4, 2026

    @melvin-bot

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

  3. melvin-bot commented on Mar 4, 2026

    @melvin-bot

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

  4. github-actions commented on Mar 4, 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.
  5. melvin-bot commented on Mar 4, 2026

    @melvin-bot

    Triggered auto assignment to @lydiabarclay (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  6. added
    Daily
    and removed
    Hourly
    on Mar 4, 2026
  7. puneetlath commented on Mar 4, 2026

    @puneetlath
    Contributor

    I think we just need to add this to the BE whitelist. Not an app deploy blocker.

  8. removed
    DeployBlockerCash
    on Mar 4, 2026
  9. OSBotify commented on Mar 4, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #82982 - "fix: add a tooltip to train users" by @daledah (High confidence)
    Related Issues: #81737

    Recommendation: REVERT

    The tooltip dismissal state is not persisted through cache clear/restart operations, causing a poor user experience where users must repeatedly dismiss the same tooltip.

    Labels: This issue is correctly labeled with DeployBlockerCash. No label changes needed at this time.

    📋 Detailed Analysis

    Evidence

    PR #82982 added a new product training tooltip for the "Has" filter in the search filters page. The tooltip can be dismissed by users clicking the X button. The issue reports that after dismissing the tooltip and using "Clear cache and restart" (or relogin), the dismissed tooltip reappears.

    Verification

    The PR modifies the following relevant files:

    • src/components/ProductTrainingContext/TOOLTIPS.ts - Added HAS_FILTER_NEGATION tooltip configuration
    • src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersHasPage.tsx - Added the tooltip to the Has filter page
    • src/types/onyx/DismissedProductTraining.ts - Added the new tooltip type
    • src/CONST/index.ts - Added the tooltip name constant

    The PR introduces the exact feature mentioned in the bug report (tooltip on Has filter that should be dismissible).

    Root Cause

    When a user dismisses the tooltip, the app calls dismissProductTraining() which:

    1. Optimistically updates ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING in local storage
    2. Makes an API call to persist the dismissal to the server

    However, when "Clear cache and restart" is executed:

    1. It calls Onyx.clear(KEYS_TO_PRESERVE) in src/libs/actions/App.ts
    2. ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING is NOT in the KEYS_TO_PRESERVE array (lines 122-145 of App.ts)
    3. The dismissed tooltip state is cleared from local Onyx storage
    4. After restart, openApp() should fetch this data from the server, but there appears to be a timing issue or the data is not being properly restored

    The issue is reproducible because:

    This is a Frontend bug because the fix requires changes to how the App handles dismissed product training state persistence, not a backend API issue.

  10. mkhutornyi commented on Mar 4, 2026

    @mkhutornyi
  11. puneetlath commented on Mar 4, 2026

    @puneetlath
    Contributor

    I'll raise a BE PR.

  12. MelvinBot commented on Mar 4, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a user dismisses the "Has" filter tooltip (introduced in PR #82982), the tooltip reappears after performing "Clear cache and restart" or relogging in. The dismissal should persist across these actions.

    What is the root cause of that problem?

    The tooltip dismissal is stored in the Onyx key NVP_DISMISSED_PRODUCT_TRAINING (nvp_dismissedProductTraining). When dismissed, two things happen:

    1. An optimistic Onyx merge sets the local state immediately (src/libs/actions/Welcome/index.ts:152-168)
    2. An API.write(DISMISS_PRODUCT_TRAINING) call is queued to persist the dismissal server-side

    The problem is that NVP_DISMISSED_PRODUCT_TRAINING is not included in the KEYS_TO_PRESERVE list used by clearOnyxAndResetApp() (src/libs/actions/App.ts:122-145). When the user clears cache:

    1. Onyx.clear(KEYS_TO_PRESERVE) wipes the local dismissal state (line 765)
    2. IS_LOADING_APP is preserved as false (it's in KEYS_TO_PRESERVE)
    3. openApp() is called in a .then() chain (line 796), but before it runs and sets isLoadingApp = true, there's a window where isLoadingApp is false and dismissedProductTraining is undefined
    4. shouldTooltipBeVisible() (src/components/ProductTrainingContext/index.tsx:129) checks isLoadingApp as a guard, but during this gap it passes through, and isProductTrainingElementDismissed() (src/libs/TooltipUtils.ts:4-5) returns false because the value is undefined

    For the relogin path, the issue is more severe: cleanupSession() calls PersistedRequests.clear(), which permanently wipes any pending DismissProductTraining API writes from the sequential queue. If the write hadn't been sent to the server yet, the dismissal is permanently lost — the server never learns about it, and subsequent OpenApp calls won't include it.

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

    Add ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING to the KEYS_TO_PRESERVE array in src/libs/actions/App.ts (around line 122-145). This ensures that when clearOnyxAndResetApp() calls Onyx.clear(), the tooltip dismissal state is retained locally, eliminating both the race condition and any risk of losing pending writes.

    This is consistent with how other user-preference NVPs like NVP_TRY_FOCUS_MODE and NVP_PREFERRED_LOCALE are already preserved in the same list.

    What alternative solutions did you explore? (Optional)

    1. Guard on undefined NVP state: Modify ProductTrainingContextProvider to suppress all tooltips when dismissedProductTraining is undefined (not just when isLoadingApp is true). This would close the race condition gap but wouldn't help if the API write is lost during sign-out.

    2. Set isLoadingApp = true before Onyx.clear(): This would suppress tooltips during the entire clear-and-reload cycle, but it's a broader change that affects more than just product training tooltips.

    Adding to KEYS_TO_PRESERVE is the most targeted and minimal fix — it matches how the codebase already handles similar NVP keys that should survive cache clears.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.

  13. puneetlath commented on Mar 4, 2026

    @puneetlath
    Contributor
  14. puneetlath commented on Mar 9, 2026

    @puneetlath
    Contributor

    This is fixed.

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

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions