You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-08-05] Subscription - "Stay Ahead of the Deadline” modal is shown when account has no workspace #97168
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:
Go to staging.new.expensify.com
Create a new Gmail account.
Create a workspace.
Delete the workspace.
Go to Inbox.
Wait for 5 minutes.
Click Add payment card on "Stay Ahead of the Deadline” modal.
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.
👋 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:
Identify the pull request that introduced this issue and revert it.
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).
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.
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
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
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]
Activity
melvin-bot commentedon Jul 27, 2026
@grgia recently merged #96275, but they are OOO right now, so I'll auto-assign someone else.
applause-bot commentedon Jul 27, 2026
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
melvin-bot commentedon Jul 27, 2026
Triggered auto assignment to @amyevans (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Jul 27, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jul 27, 2026
👋 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:
MelvinBot commentedon Jul 27, 2026
🔍 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.
DeployBlockerCashis kept (App deploy is blocked by a frontend bug).DeployBlockeris not present, so nothing to remove.📋 Detailed Analysis
Evidence
/settings/subscription/add-payment-card).src/hooks/useTrialPaymentReminder.ts,src/components/TrialPaymentReminderModalManager.tsx, andsrc/components/TrialPaymentReminderModal.tsx— are new files added by this PR (they appear only in its merge commit; no prior history).Verification
Affected file(s):
src/hooks/useTrialPaymentReminder.ts— computesisEligibleToShow, the gate for rendering the modal.src/components/TrialPaymentReminderModalManager.tsx— mounts the modal globally (registered insrc/GlobalModals.tsxasLazyTrialPaymentReminderModalManager).Confirmed the PR modifies/creates these exact files (from
gh pr view 96275 --json files).Root Cause
The modal's eligibility is computed in
useTrialPaymentReminderand depends only on the free-trial NVP dates and payment-card status:isEligibleToShowgates onisUserOnFreeTrial(firstDayFreeTrial, lastDayFreeTrial)anddoesUserHavePaymentCardAdded(billingFundID)—src/hooks/useTrialPaymentReminder.tslines 221-248.isUserOnFreeTrialonly checks that "now" is betweenfirstDayFreeTrialandlastDayFreeTrial—src/libs/SubscriptionUtils.tslines 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/lastDayFreeTrialaccount-level NVPs. Deleting the workspace does not clear those NVPs, soisUserOnFreeTrialstill returnstrueand 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.tslines 141 and 386-388). The newuseTrialPaymentReminderhook 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(mirroringgetOwnedPaidPolicies(...).length > 0used elsewhere inSubscriptionUtils.ts) so the modal only appears while the account still owns at least one workspace.2 remaining items
grgia commentedon Jul 28, 2026
@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
grgia commentedon Jul 28, 2026
Can you push the FE fix @dukenv0307
dukenv0307 commentedon Jul 28, 2026
@grgia okay, I'll raise the FE PR soon
amyevans commentedon Jul 28, 2026
PR is CP'ed and requested retest: https://expensify.slack.com/archives/C09V78U42D8/p1785272594570429
m-natarajan commentedon Jul 28, 2026
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
amyevans commentedon Jul 29, 2026
Thank you!
[-]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[/+]melvin-bot commentedon Jul 29, 2026
@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]