Skip to content

[Due for payment 2026-09-25] Public room - Public room loads infinitely after dismissing AI modal #97847

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.50-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/67668897/folder/13176964/41237763/1630482459?q=public+room&issue_type=jira&sort=-identifier
Email or phone of affected tester (no customers): sdsiodjnosdjiodsj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Mac 26.5 / Chrome
App Component: Chat Report View

Action Performed:

  1. Go to staging.new.expensify.com
  2. Log out if logged in.
  3. Go to public room - https://staging.new.expensify.com/r/1540486774487195
  4. Wait for AI modal to appear.
  5. Dismiss AI modal.

Expected Result:

Public room will not load infinitely after dismissing AI modal.

Actual Result:

Public room loads infinitely after dismissing AI modal.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7225988_1785882707441.5.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7225988

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. applause-bot commented on Aug 5, 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/a0b188f041f68172126f4d44825f1dbd3f4be038025986c5b084de6d1042da97

  2. added
    Daily
    Bug
    on Aug 5, 2026
  3. MelvinBot commented on Aug 5, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The AI Features promo modal (the "AI modal" in the repro) is being shown to logged-out / anonymous users, when it should only ever appear for signed-in users. It's a promo for authenticated AI features and has no business appearing on a public room for an anonymous visitor.

    The eligibility check in useAIFeaturesPromoModal.ts:73-82 gates on !!session?.authToken — but anonymous users also carry an authToken (only authTokenType differs, ANONYMOUS), so the gate passes for them. There is no isAnonymousUser() guard, and useShouldSuppressPromotionalUI.ts:15-24 only suppresses supportal/copilot sessions — not anonymous ones.

    Dismissing the modal (AIFeaturesPromoModal.tsx:73-80) then fires a persisted DISMISS_PRODUCT_TRAINING write, which an anonymous session isn't authorized to make — the resulting reauth pauses the network queue and starves the OPEN_REPORT the public room is waiting on, so the loading skeleton never resolves → infinite load.

    Evidence & data flow
    • The modal + its trigger hook are mounted for anonymous public-room sessions (they run inside AuthScreens with an anon token).
    • Why it shows: isEligible requires !!session?.authToken — true for anonymous (isAnonymousUser checks authTokenType === ANONYMOUS, src/libs/actions/Session/index.ts). No anonymous exclusion anywhere in the gate or in useShouldSuppressPromotionalUI.
    • Why it hangs after dismiss (medium confidence): both exit paths do Navigation.goBack() + dismissProductTraining() → API.write(DISMISS_PRODUCT_TRAINING) (Welcome/index.ts). On an anonymous session this write is unauthorized → Reauthentication.ts pauses the SequentialQueue; anonymous reauth has no real credentials, so it stalls/loops. That starves OPEN_REPORT (Report/index.ts), whose optimistic isLoadingInitialReportActions:true never flips back, so ReportActions.tsx:71-95 keeps rendering the skeleton.

    The "why the modal shows to anonymous users" part is high confidence (verified in code). The exact downstream queue-stall mechanism is medium confidence — it depends on how the backend handles a DISMISS_PRODUCT_TRAINING write from an anonymous session, which lives outside the App repo. Regardless of the precise stall path, the modal should not appear for anonymous users in the first place, which removes the trigger entirely.

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

    Add an anonymous-user guard to the promo modal's eligibility so it never shows to logged-out users. The cleanest spot is the isEligible check in useAIFeaturesPromoModal.ts: require the session to be non-anonymous (e.g. session?.authTokenType !== CONST.AUTH_TOKEN_TYPES.ANONYMOUS) in addition to !!session?.authToken. Alternatively (or additionally), extend useShouldSuppressPromotionalUI to also suppress anonymous sessions, which would cover all promo/training/onboarding UI in one place.

    What alternative solutions did you explore? (Optional)

    Blocking the DISMISS_PRODUCT_TRAINING write for anonymous sessions would stop the queue stall, but it treats the symptom — the modal still wrongly appears. Fixing eligibility is the correct root-cause fix.


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

  4. added
    External
    on Aug 5, 2026
  5. melvin-bot commented on Aug 5, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

  6. melvin-bot commented on Aug 5, 2026

    @melvin-bot
  7. j3ffffff commented on Aug 5, 2026

    @j3ffffff
  8. oqildev commented on Aug 5, 2026

    @oqildev
    Contributor

    @marcaaron Can you pls assign me per #82013 (comment) ?! thanks

  9. nkdengineer commented on Aug 5, 2026

    @nkdengineer
    Contributor

    The issue can still be reproduced even though we don't show the AI feature for anonymous user

  10. melvin-bot commented on Aug 10, 2026

    @melvin-bot

    @eVoloshchak Eep! 4 days overdue now. Issues have feelings too...

  11. melvin-bot commented on Aug 12, 2026

    @melvin-bot

    @eVoloshchak Still overdue 6 days?! Let's take care of this!

  12. 50 remaining items

  13. melvin-bot commented on Sep 24, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. melvin-bot commented on Sep 24, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  15. mallenexpensify commented on Sep 26, 2026

    @mallenexpensify
    Contributor

    ⚠️ Looks like this issue was linked to a Deploy Blocker #101525

    @eVoloshchak this issue mentions a deploy blocker or a regression. Before the payment date, post one of the three options in step 20 of the C+ doc: it was a regression, it was not, or you did not review the offending PR. If you don't post, the default is to reduce payment.

  16. eVoloshchak commented on Sep 28, 2026

    @eVoloshchak
    Contributor

    @mallenexpensify, it was caused by another PR, link to the comment: #101525 (comment)

    Image
  17. eVoloshchak commented on Sep 28, 2026

    @eVoloshchak
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR:
      Link to the comment on the Issue:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Test:

    1. Log out if logged in.
    2. Go to a public room - https://staging.new.expensify.com/r/1540486774487195
    3. Verify that the public room doesn't load infinitely

    Do we agree 👍 or 👎

  18. mallenexpensify commented on Sep 28, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @nkdengineer due $250 via NewDot
    Contributor+: @eVoloshchak due $250 via NewDot

  19. JmillsExpensify commented on Sep 30, 2026

    @JmillsExpensify
    Contributor

    $250 approved for @eVoloshchak

  20. added
    Reviewing
    Weekly
    and removed
    Daily
    on Sep 30, 2026
  21. twisterdotcom commented on Oct 28, 2026

    @twisterdotcom
    Contributor

    $250 approved for @nkdengineer in Report ID: R00Czp3CyOUj.

    Zapier Logs Run ID: 00040eee-3813-ae96-a133-b2081143f564

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

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

Metadata

Metadata

Labels

Awaiting PaymentBugExternalReviewingWeeklyretest-weekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions