Skip to content

[Due for payment 2026-08-05] Subscription - "Stay Ahead of the Deadline” modal is shown when account has no workspace #97168

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

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a new Gmail account.
  3. Create a workspace.
  4. Delete the workspace.
  5. Go to Inbox.
  6. Wait for 5 minutes.
  7. Click Add payment card on "Stay Ahead of the Deadline” modal.
  8. Close the RHP.

Expected Result:

"Stay Ahead of the Deadline” modal will not appear when account has no workspace.

Actual Result:

"Stay Ahead of the Deadline” modal is shown when account has no workspace.
After clicking Add payment card on "Stay Ahead of the Deadline” modal, central pane is blank.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7219236_1785189308608.9.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7219236

Issue OwnerCurrent Issue Owner: @shubham1206agra

Activity

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

    @melvin-bot

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

  3. applause-bot commented on Jul 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/fc4ee0d647770ad2cf64958cf6ceb036b5d47a0d31620f076855dc4bc85c329a

  4. melvin-bot commented on Jul 27, 2026

    @melvin-bot

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

  5. melvin-bot commented on Jul 27, 2026

    @melvin-bot

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

  6. github-actions commented on Jul 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 Jul 27, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #96275 - "Introduce free trial countdown pop-up" by @dukenv0307 (High confidence)
    Related Issues: N/A

    Recommendation: REVERT

    PR #96275 introduces the entire "Stay Ahead of the Deadline" free-trial reminder modal, and its eligibility logic never checks that the account still owns a workspace, so the modal (and the downstream blank subscription pane) appears for accounts with no workspace. Since this is a brand-new feature that does not exist in production, reverting cleanly unblocks the deploy with no risk of reintroducing a worse bug; a targeted fix (adding an "owns a paid policy" guard) is also acceptable as a roll-forward if the author prefers.

    Assigned: @dukenv0307 (PR author), @shubham1206agra and @grgia (approving reviewers) from #96275
    Labels: No changes. DeployBlockerCash is kept (App deploy is blocked by a frontend bug). DeployBlocker is not present, so nothing to remove.

    📋 Detailed Analysis

    Evidence

    • PR Introduce free trial countdown pop-up #96275 ("Introduce free trial countdown pop-up") is the PR that literally adds the "Stay Ahead of the Deadline" modal. Its own test steps and copy match the modal in this report verbatim (title "Stay Ahead of the Deadline", "Add payment card" button routing to /settings/subscription/add-payment-card).
    • The three core files that drive this modal — src/hooks/useTrialPaymentReminder.ts, src/components/TrialPaymentReminderModalManager.tsx, and src/components/TrialPaymentReminderModal.tsx — are new files added by this PR (they appear only in its merge commit; no prior history).
    • PR Introduce free trial countdown pop-up #96275 is listed as item 11 in the current StagingDeployCash checklist (Deploy Checklist: New Expensify 2026-07-27 #97134), and it is not in production — consistent with the report's "N/A - new feature, doesn't exist in prod."
    • melvin-bot independently flagged the same PR.

    Verification

    Affected file(s):

    • src/hooks/useTrialPaymentReminder.ts — computes isEligibleToShow, the gate for rendering the modal.
    • src/components/TrialPaymentReminderModalManager.tsx — mounts the modal globally (registered in src/GlobalModals.tsx as LazyTrialPaymentReminderModalManager).

    Confirmed the PR modifies/creates these exact files (from gh pr view 96275 --json files).

    Root Cause

    The modal's eligibility is computed in useTrialPaymentReminder and depends only on the free-trial NVP dates and payment-card status:

    • isEligibleToShow gates on isUserOnFreeTrial(firstDayFreeTrial, lastDayFreeTrial) and doesUserHavePaymentCardAdded(billingFundID) — src/hooks/useTrialPaymentReminder.ts lines 221-248.
    • isUserOnFreeTrial only checks that "now" is between firstDayFreeTrial and lastDayFreeTrial — src/libs/SubscriptionUtils.ts lines 404-416. It does not check whether the account currently owns any workspace / paid policy.

    When a user creates a workspace, the backend sets the firstDayFreeTrial/lastDayFreeTrial account-level NVPs. Deleting the workspace does not clear those NVPs, so isUserOnFreeTrial still returns true and the modal is shown even though the account has zero workspaces.

    Notably, other trial-related helpers in this same file correctly gate on ownership via getOwnedPaidPolicies(policies, currentUserAccountID)?.length (e.g. src/libs/SubscriptionUtils.ts lines 141 and 386-388). The new useTrialPaymentReminder hook omits that guard entirely.

    The "blank central pane" is a downstream symptom of the same root cause: clicking "Add payment card" navigates to SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD (src/pages/home/common/navigateToSubscriptionPayment/index.tsx), an RHP over the Subscription settings page. With no owned paid workspace, the underlying Subscription page has nothing to render, so after closing the RHP the central pane is blank. Guarding the feature on workspace ownership resolves both symptoms.

    Suggested fix (if rolling forward instead of reverting)

    Add an owned-paid-policy check to the eligibility computation in useTrialPaymentReminder (mirroring getOwnedPaidPolicies(...).length > 0 used elsewhere in SubscriptionUtils.ts) so the modal only appears while the account still owns at least one workspace.

  8. 2 remaining items

  9. removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jul 28, 2026
  10. grgia commented on Jul 28, 2026

    @grgia
    Contributor

    DeleteWorkspace on the backend doesn't clear firstDayFreeTrial/lastDayFreeTrial NVPs, should we remove them when delete WS?

    @dukenv0307 I think no, we don't restart the trial or clear it because the workspace is deleted. I agree we should gate on workspace ownership existing too

  11. grgia commented on Jul 28, 2026

    @grgia
    Contributor

    Can you push the FE fix @dukenv0307

  12. dukenv0307 commented on Jul 28, 2026

    @dukenv0307
    Contributor

    @grgia okay, I'll raise the FE PR soon

  13. amyevans commented on Jul 28, 2026

    @amyevans
    Contributor
  14. m-natarajan commented on Jul 28, 2026

    @m-natarajan

    Chrome / v9.4.45-8
    After waiting 7 minutes "Stay Ahead of the Deadline” modal not appeared

    bandicam.2026-07-29.00-16-36-457.mp4
  15. amyevans commented on Jul 29, 2026

    @amyevans
    Contributor

    Thank you!

  16. changed the title [-]Subscription - "Stay Ahead of the Deadline” modal is shown when account has no workspace[/-] [+][Due for payment 2026-08-05] Subscription - "Stay Ahead of the Deadline” modal is shown when account has no workspace[/+] on Jul 29, 2026
  17. melvin-bot commented on Jul 29, 2026

    @melvin-bot

    @shubham1206agra

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.45-14 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-08-05. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions