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-12-08] [$250] Defer the “Stay ahead of the deadline” modal until the user’s second session #107238
The trial payment reminder (“Stay ahead of the deadline”) interrupts users during their first session, before they have explored the product.
Proposed change
Suppress the modal throughout the first session. From the second session onward—even on the same day—preserve existing eligibility, reminder timing, and dismissal behavior.
This does not introduce a seven-day minimum or require a submitted report.
Acceptance criteria
Never show the modal during the first session, including after the five-minute grace period or onboarding completion.
Preserve existing behavior from the second session onward.
Allow users to voluntarily add a billing card at any time.
Do not incorrectly classify existing users as first-session users.
Verify behavior on web and native.
Technical scope
Update the frontend eligibility logic in src/hooks/useTrialPaymentReminder.ts. Define session boundaries and check whether existing state reliably distinguishes first and subsequent sessions. Backend work is only needed if the agreed session tracking requires additional account-level persistence.
Measurement
Compare billing-card addition and trial-to-paid conversion after rollout.
changed the title [-]Defer the “Stay ahead of the deadline” modal until the user’s second session[/-][+][$175] Defer the “Stay ahead of the deadline” modal until the user’s second session[/+]on Nov 18, 2026
The reminder has a five-minute grace period, but no first-session exclusion. After that timer expires, a user can qualify for the day-one reminder without leaving their first session. Completing onboarding removes another modal blocker, allowing the reminder to appear immediately.
What changes do you think we should make in order to solve the problem?
Add a first-session exclusion to the reminder’s eligibility check, with the suppression decision fixed for the entire session. Preserve existing grace periods, reminder windows, eligibility checks, and dismissal behavior. Do not change voluntary billing-card access or record suppression as a dismissal.
Proposed session definition: an authenticated interactive app runtime. Reloading, opening another tab, or cold-launching starts another session; backgrounding, reconnecting, completing onboarding, and component remounts do not. Opening another tab must not release suppression in the original tab.
Implementation prerequisite: confirm how every authentication path reliably identifies a genuinely new account. Missing local state must not classify an existing user as new.
If no existing authoritative signal covers the agreed session definition, this requires escalation to an internal engineer for backend support before an App-only implementation can proceed.
Regression coverage: first-session suppression beyond five minutes and onboarding completion; same-day second-session eligibility; unchanged dismissal behavior; returning users with cleared storage; Google/Apple authentication; multiple tabs; and voluntary card addition. Web and native lifecycle verification remain required after implementation.
What alternative solutions did you explore? (Optional)
Longer delays, onboarding completion, and local “first launch” flags do not reliably distinguish the first account session from later sessions.
Next Steps for Contributor+ team: To refine:@MelvinBot <your feedback> — confirm session boundaries and the authoritative new-account signal first. To accept: Resolve those prerequisites before requesting implementation. To reject: Explain why you are rejecting Melvin’s proposal.
The linked proposal has one unresolved prerequisite: reliably identifying a new account across all authentication paths.
Your request accepts the proposed session boundaries, but it does not resolve that technical gap. Google/Apple authentication supports both signup and returning-user login; the available frontend evidence does not confirm a reliable discriminator. Using missing local state would risk incorrectly suppressing reminders for existing users.
To unblock: an internal engineer needs to confirm the authoritative new-account signal for each authentication path, or arrange backend support if none exists.
Please re-state the problem that we are trying to solve in this issue.
The "Stay ahead of the deadline" trial reminder shows up during the user's very first session, right after the trial starts. We want to hold it back for that whole first session and keep everything as it is from the second session on.
What is the root cause of that problem?
useTrialPaymentReminder only knows about a 5 minute grace window. When the trial appears mid-session, the hook goes PRE_TRIAL -> TRIAL_STARTUP_GRACE, and after 5 minutes the timer moves it to READY:
From READY the modal is eligible as soon as currentVariation is day1, which is the case for the whole first day. Nothing in the hook knows which session we're in, so it shows in the same session where the user just created their workspace.
What changes do you think we should make in order to solve the problem?
I think we can skip the "is this a brand new account" question that blocked MelvinBot's implementation. We don't need to know if the account is new. We only need to know if the trial started in the session the user is in right now, and the hook already detects that moment (PRE_TRIAL -> trial appears, or the trial is less than 5 minutes old on load). An existing user's trial is older than that when the app loads, so they can never be marked, whatever sign-in path they used (Google, Apple, magic code) and even with cleared storage.
I'd define a session as one app launch: one tab/page load on web (a reload in the same tab is still the same session), and one cold start on native. Then we only need to remember "the trial started in this session". We don't need any backend change or a new NVP.
Add a small helper src/libs/TrialSessionUtils with a web and a native version, same as we already do in lastVisitedTabPathUtils:
Web: save the firstDayFreeTrial value in sessionStorage under a new CONST.SESSION_STORAGE_KEYS.TRIAL_STARTED_IN_SESSION. It survives reloads in the tab, and it's gone in a new tab or window. It's also wiped on sign out because clearSessionStorage clears everything.
Native: a module-level variable, which lives until the app is killed.
The value is the trial start date, not just a boolean, so switching accounts in the same tab can't suppress the modal for a different trial.
In the hook, mark the session where we already detect a new trial:
We also mark it in the LOADING branch when the grace window is still running. That covers the manager mounting right after the workspace is created, or a reload a minute later:
Everything else (variations, dismissals, countdown) stays the same, so from the second session on the behavior is exactly what we have now, even on the same day. Existing users are never marked, because their trial was already there (and past the grace window) when the app loaded. The modal only reads this flag, so adding a card from Subscription settings is not affected at all.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
In useTrialPaymentReminder tests (fake timers, paid policy, no card):
Start with no trial, then set firstDayFreeTrial to now. After 5 minutes and after 2 hours, isEligibleToShow stays false.
Same as 1, then reset the helper (simulates a new session) and mount again. isEligibleToShow is true on day 1.
Trial already 3 days old on mount: eligible right away, same as today (existing user isn't treated as first session).
Trial created 1 minute before mount (reload during first session): not eligible, even after the grace window ends.
Mark the session for trial A, switch to an account with trial B: B is eligible.
What alternative solutions did you explore? (Optional)
Persisting a "first session done" flag in an NVP. That would also cover a second device on the same day, but it needs backend work and the issue says to avoid that unless needed.
Just making the grace window longer (e.g. 24h). Simpler, but it would also hide the modal in a real second session on the same day, which the issue asks us to keep.
📣 @dostonbunyodov0006 You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖
changed the title [-][$250] Defer the “Stay ahead of the deadline” modal until the user’s second session[/-][+][Due for payment 2026-12-08] [$250] Defer the “Stay ahead of the deadline” modal until the user’s second session[/+]on Dec 1, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.56-2 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-12-08. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]
[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: N/A (This is an enhanced requirement that wasn't accounted for previously. We're introducing improved expected behavior, so this isn't a regression.)
Link to the comment on the Issue: N/A
[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: N/A (This isn't a CRITICAL issue; it's just an improvement to the expected behavior.)
[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:
Sign up with a new user (email, Google or Apple).
Go through onboarding and choose an option that creates a workspace(e.g. select Manage my team's expenses on onboardig purpose), so the free trial starts.
Finish onboarding and stay in the app for more than 5 minutes (navigate around, open reports, etc.).
Verify the "Stay ahead of the deadline" modal does not appear at any point during this session.
reload the page (web) or kill and relaunch the app (native).
Verify the "Stay ahead of the deadline" modal now appears.
Close it and verify it doesn't come back until the next reminder day.
Activity
expensify-chore-bot commentedon Nov 18, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mkhutornyi (
External)[-]Defer the “Stay ahead of the deadline” modal until the user’s second session[/-][+][$175] Defer the “Stay ahead of the deadline” modal until the user’s second session[/+]expensify-chore-bot commentedon Nov 18, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022123028949578815118
mkhutornyi commentedon Nov 18, 2026
@MelvinBot post proposal
MelvinBot commentedon Nov 18, 2026
Proposal
What is the root cause of that problem?
The reminder has a five-minute grace period, but no first-session exclusion. After that timer expires, a user can qualify for the day-one reminder without leaving their first session. Completing onboarding removes another modal blocker, allowing the reminder to appear immediately.
Code evidence
What changes do you think we should make in order to solve the problem?
Add a first-session exclusion to the reminder’s eligibility check, with the suppression decision fixed for the entire session. Preserve existing grace periods, reminder windows, eligibility checks, and dismissal behavior. Do not change voluntary billing-card access or record suppression as a dismissal.
Proposed session definition: an authenticated interactive app runtime. Reloading, opening another tab, or cold-launching starts another session; backgrounding, reconnecting, completing onboarding, and component remounts do not. Opening another tab must not release suppression in the original tab.
Implementation prerequisite: confirm how every authentication path reliably identifies a genuinely new account. Missing local state must not classify an existing user as new.
Why this prerequisite matters
Google/Apple authentication can both create accounts and sign in returning users. The frontend declares an optional accountExists response field, but this checkout does not establish its availability or meaning for those responses.
If no existing authoritative signal covers the agreed session definition, this requires escalation to an internal engineer for backend support before an App-only implementation can proceed.
Regression coverage: first-session suppression beyond five minutes and onboarding completion; same-day second-session eligibility; unchanged dismissal behavior; returning users with cleared storage; Google/Apple authentication; multiple tabs; and voluntary card addition. Web and native lifecycle verification remain required after implementation.
What alternative solutions did you explore? (Optional)
Longer delays, onboarding completion, and local “first launch” flags do not reliably distinguish the first account session from later sessions.
Next Steps for Contributor+ team:
To refine:
@MelvinBot <your feedback>— confirm session boundaries and the authoritative new-account signal first.To accept: Resolve those prerequisites before requesting implementation.
To reject: Explain why you are rejecting Melvin’s proposal.
view run
mkhutornyi commentedon Nov 18, 2026
@MelvinBot implement this
melvin-bot commentedon Nov 18, 2026
melvin-bot commentedon Nov 18, 2026
Details
MelvinBot commentedon Nov 18, 2026
🤖 Implementation blocked
The linked proposal has one unresolved prerequisite: reliably identifying a new account across all authentication paths.
Your request accepts the proposed session boundaries, but it does not resolve that technical gap. Google/Apple authentication supports both signup and returning-user login; the available frontend evidence does not confirm a reliable discriminator. Using missing local state would risk incorrectly suppressing reminders for existing users.
To unblock: an internal engineer needs to confirm the authoritative new-account signal for each authentication path, or arrange backend support if none exists.
No code changes or PR were created.
view run
SrkaLo92 commentedon Nov 18, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The "Stay ahead of the deadline" trial reminder shows up during the user's very first session, right after the trial starts. We want to hold it back for that whole first session and keep everything as it is from the second session on.
What is the root cause of that problem?
useTrialPaymentReminderonly knows about a 5 minute grace window. When the trial appears mid-session, the hook goesPRE_TRIAL->TRIAL_STARTUP_GRACE, and after 5 minutes the timer moves it toREADY:https://github.com/Expensify/App/blob/30878a312c9/src/hooks/useTrialPaymentReminder.ts#L180-L203
From
READYthe modal is eligible as soon ascurrentVariationisday1, which is the case for the whole first day. Nothing in the hook knows which session we're in, so it shows in the same session where the user just created their workspace.What changes do you think we should make in order to solve the problem?
I think we can skip the "is this a brand new account" question that blocked MelvinBot's implementation. We don't need to know if the account is new. We only need to know if the trial started in the session the user is in right now, and the hook already detects that moment (
PRE_TRIAL-> trial appears, or the trial is less than 5 minutes old on load). An existing user's trial is older than that when the app loads, so they can never be marked, whatever sign-in path they used (Google, Apple, magic code) and even with cleared storage.I'd define a session as one app launch: one tab/page load on web (a reload in the same tab is still the same session), and one cold start on native. Then we only need to remember "the trial started in this session". We don't need any backend change or a new NVP.
Add a small helper
src/libs/TrialSessionUtilswith a web and a native version, same as we already do inlastVisitedTabPathUtils:markTrialStartedInCurrentSession(firstDayFreeTrial)/didTrialStartInCurrentSession(firstDayFreeTrial)firstDayFreeTrialvalue insessionStorageunder a newCONST.SESSION_STORAGE_KEYS.TRIAL_STARTED_IN_SESSION. It survives reloads in the tab, and it's gone in a new tab or window. It's also wiped on sign out becauseclearSessionStorageclears everything.In the hook, mark the session where we already detect a new trial:
We also mark it in the
LOADINGbranch when the grace window is still running. That covers the manager mounting right after the workspace is created, or a reload a minute later:isEligibleToShow:Everything else (variations, dismissals, countdown) stays the same, so from the second session on the behavior is exactly what we have now, even on the same day. Existing users are never marked, because their trial was already there (and past the grace window) when the app loaded. The modal only reads this flag, so adding a card from Subscription settings is not affected at all.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
In
useTrialPaymentRemindertests (fake timers, paid policy, no card):firstDayFreeTrialto now. After 5 minutes and after 2 hours,isEligibleToShowstaysfalse.isEligibleToShowistrueon day 1.What alternative solutions did you explore? (Optional)
flaviadefaria commentedon Nov 18, 2026
@mkhutornyi do you think Melvin might be able to implement this?
flaviadefaria commentedon Nov 18, 2026
melvinbot please draft a proposal for this change.
59 remaining items
melvin-bot commentedon Nov 26, 2026
📣 @dostonbunyodov0006 You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖
dostonbunyodov0006 commentedon Nov 26, 2026
@jayeshmangwani pr ready to review
[-][$250] Defer the “Stay ahead of the deadline” modal until the user’s second session[/-][+][Due for payment 2026-12-08] [$250] Defer the “Stay ahead of the deadline” modal until the user’s second session[/+]melvin-bot commentedon Dec 1, 2026
@jayeshmangwani
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.56-2 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-12-08. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]
jayeshmangwani commentedon Dec 2, 2026
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: N/A (This is an enhanced requirement that wasn't accounted for previously. We're introducing improved expected behavior, so this isn't a regression.)
Link to the comment on the Issue: N/A
[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: N/A (This isn't a CRITICAL issue; it's just an improvement to the expected behavior.)
[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:
Manage my team's expenseson onboardig purpose), so the free trial starts.Do we agree 👍 or 👎