Repository navigation
Description
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.61-0
Reproducible in staging?: Yes
Reproducible in production?: Unable to validate in Prod - Provide reasoning.
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/40579099/test-cases/88870317
Email or phone of affected tester (no customers): -
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Ventura / Chrome
App Component: Other
Action Performed:
Precondition:
- Login with a new account and create a Collect workspace.
- Ensure no billing card is on file.
- Navigate to Account > Subscription
- Run the snippet to set nvp_private_firstDayFreeTrial to today's date (May require page refresh):
Onyx.set('nvp_private_firstDayFreeTrial', '2026-04-21T09:00:00');
STR:
- Navigate to the Home page
- "Time sensitive" section appears at the top of the left column
Expected Result:
Verify the item displays a stopwatch icon
Verify the title is "50% off your first year"
Verify the supporting text shows a live countdown: "{HH}h {MM}m {SS}sec remaining"
Actual Result:
No expencted format banner.
Something like 'Trial: 30 days left!' only.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
Screenshots/Videos
Video.mp4
Issue Owner
Current Issue Owner: @mallenexpensifyUpwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022046615970624008812
- Upwork Job ID: 2046615970624008812
- Last Price Increase: 2026-04-28
- Automatic offers:
- thelullabyy | Reviewer | 111332017
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
MelvinBot commentedon Apr 21, 2026
Proposal
What is the root cause of that problem?
The "50% off your first year" discount banner with the live countdown is intentionally suppressed for Collect (Team) workspace users with 2025 pricing by an explicit guard in
shouldShowDiscountBanner:When a new user creates a Collect workspace in 2026:
useHasTeam2025Pricingreturnstrue(user created after April 1, 2025 or has nofirstPolicyDate)useSubscriptionPlanreturnsTEAM(Collect = Team type, no Corporate workspace)shouldShowDiscountBanner→false, sodiscountTypebecomesnullinuseFreeTrialAs a result,
FreeTrialSectionrenders in fallback mode — showing "Free trial: N days left!" with "Don't wait! Add your payment card now." instead of the discount offer + countdown. The "Trial: 30 days left!" text the reporter sees is from the separateFreeTrialbadge in the inbox header, which is unrelated to the Home page widget.What changes do you think we should make in order to solve the problem?
Remove the Team 2025 pricing exclusion at SubscriptionUtils.ts:168-170 so the discount banner shows for all free trial users regardless of pricing tier, or update it to only suppress the discount for a specific scenario if there's a business reason for the exclusion.
Since this was caught by a regression test that explicitly expects the discount banner for Collect workspace users, removing the guard seems like the correct fix. The
FreeTrialSectionwidget and countdown logic already work correctly — they're just being gated off.What alternative solutions did you explore? (Optional)
An alternative would be to keep the exclusion but create a separate Team-2025-specific banner variant in
FreeTrialSection. However, the simpler approach of removing the guard is preferable unless there's a deliberate business reason to suppress discounts for Team 2025 pricing users.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.melvin-bot commentedon Apr 21, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thelullabyy (
External)[-]Home - No expected banner shown after running a snippet[/-][+][$250] Home - No expected banner shown after running a snippet[/+]melvin-bot commentedon Apr 21, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022046615970624008812
MobileMage commentedon Apr 21, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After running an Onyx snippet to set
nvp_private_firstDayFreeTrialon an already-mounted Home page, the expected "50% off your first year" discount banner with a live countdown does not appear — instead the generic "Trial: 30 days left!" text is shown.What is the root cause of that problem?
The
useFreeTrialhook initializesdiscountInfovia auseStatelazy initializer that only runs once on mount. WhenfirstDayFreeTrialis set via the snippet after the component is already mounted,showDiscountbecomestrueand theuseEffectre-runs. However, the effect's cleanup from the previous render firessetDiscountInfo(null)before the new interval is set up, and the new interval only populatesdiscountInfoafter a full 1-second tick. During that window — and on the very first render after the Onyx value is received —discountInfoisnull, sogetDiscountTypereturnsnulland the component falls through to the generic "add card" path.The fundamental problem is that the effect never sets
discountInfoimmediately when it starts; it only updates on subsequent interval ticks. Combined with the cleanup unconditionally resettingdiscountInfotonull, there is always at least a 1-second gap wherediscountTypeisnull.App/src/pages/home/FreeTrialSection/useFreeTrial.ts
Lines 48 to 63 in 8a6f5bb
What changes do you think we should make in order to solve the problem?
Set
discountInfoimmediately at the start of the effect instead of waiting for the first interval tick, and remove the cleanup'ssetDiscountInfo(null)call so that the existing discount info is not wiped between re-renders.App/src/pages/home/FreeTrialSection/useFreeTrial.ts
Lines 50 to 63 in 8a6f5bb
useEffect(() => { if (!showDiscount) { + setDiscountInfo(null); return; } + setDiscountInfo(getEarlyDiscountInfo(firstDayFreeTrial)); + const intervalID = setInterval(() => { setDiscountInfo(getEarlyDiscountInfo(firstDayFreeTrial)); }, CONST.MILLISECONDS_PER_SECOND); return () => { clearInterval(intervalID); - setDiscountInfo(null); }; }, [firstDayFreeTrial, showDiscount]);The
setDiscountInfo(null)is moved into the!showDiscountbranch so it still clears when the discount is no longer applicable, while the immediatesetDiscountInfocall ensures the correct discount info is available on the very first render afterfirstDayFreeTrialis set.What alternative solutions did you explore? (Optional)
N/A
alexanderxfgl-bit commentedon Apr 21, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The home page is not displaying the expected "50% off your first year" banner after running a snippet to set the
nvp_private_firstDayFreeTrialOnyx key. Instead, it's showing a generic "Trial: 30 days left!" banner.What is the root cause of that problem?
The
useTimeSensitiveBillinghook (src/pages/home/TimeSensitiveSection/hooks/useTimeSensitiveBilling.ts, line 13) is responsible for determining which banner to display. Currently, it only checks for billing errors and doesn't consider thenvp_private_firstDayFreeTrialkey, which is used to trigger the free trial banner. This causes the component to fall back to the default trial banner.What changes do you think we should make in order to solve the problem?
Modify the
useTimeSensitiveBillinghook to check thenvp_private_firstDayFreeTrialOnyx key and return a boolean value indicating whether the free trial banner should be displayed. This will allow the component to correctly render the "50% off your first year" banner when the condition is met.What alternative solutions did you explore? (Optional)
N/A
alexanderxfgl-bit commentedon Apr 21, 2026
Contributor details
Your Expensify account email: alexanderxfgl@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~2021935202864784599
melvin-bot commentedon Apr 21, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
alexanderxfgl-bit commentedon Apr 21, 2026
Compare branch with the fix: https://github.com/Expensify/App/compare/main...alexanderxfgl-bit/App:fix/88447-ai?expand=1
57 remaining items
thelullabyy commentedon May 28, 2026
BugZero 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
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:
[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.
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-f054-a1b1-37b6-eb9f242bb3a4mallenexpensify commentedon May 29, 2026
Payment Summary
Contributor: @abbasifaizan70 paid $250 via Upwork
Contributor+: @thelullabyy paid $250 via Upwork
@abbasifaizan70 can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, and an Upwork job exists, please submit a proposal.
https://www.upwork.com/jobs/~022046615970624008812
^ Test case created. Thx
melvin-bot commentedon Jun 1, 2026
@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Jun 5, 2026
@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
abbasifaizan70 commentedon Jun 5, 2026
@mallenexpensify, Offer accepted and waiting for your approval. Thank
mallenexpensify commentedon Jun 6, 2026
@abbasifaizan70 paid, summary updated above. Thx.