Skip to content

Remove confusing 'getting low on credits' message for newly signed up users#4097

Merged
jurgenwerk merged 2 commits intomainfrom
cs-10292-when-new-user-signs-up-it-will-say-we-topped-up-your-account
Mar 3, 2026
Merged

Remove confusing 'getting low on credits' message for newly signed up users#4097
jurgenwerk merged 2 commits intomainfrom
cs-10292-when-new-user-signs-up-it-will-say-we-topped-up-your-account

Conversation

@jurgenwerk
Copy link
Contributor

@jurgenwerk jurgenwerk commented Mar 2, 2026

Summary

  • New users who just signed up were seeing "We topped up your account to 2,000 credits since you were getting low" even though they hadn't used any credits yet
  • Added a dailyCreditGrantCount field to the /_user endpoint that counts how many daily_credit ledger entries exist for the user
  • The "topped up" message is now only shown when dailyCreditGrantCount > 1, meaning the daily cron has actually topped up the user after they spent credits and went below the threshold
  • Fresh users with only the initial signup grant (count=1) will only see "Last daily credits grant: ..."

Closes CS-10292

Test plan

  • Sign up as a new user and verify the "topped up" message does not appear, only "Last daily credits grant" is shown
  • Use credits until below threshold, wait for daily cron to top up, then verify the "topped up" message appears
  • Verify the "next daily grant" message still works for users below threshold

🤖 Generated with Claude Code

image

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Preview deployments

@jurgenwerk jurgenwerk force-pushed the cs-10292-when-new-user-signs-up-it-will-say-we-topped-up-your-account branch from 2faa3ba to 682beb1 Compare March 2, 2026 11:40
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Host Test Results

    1 files  ±    0      1 suites  ±0   3h 46m 7s ⏱️ + 1h 51m 37s
1 919 tests +    1  1 902 ✅ ±    0  15 💤 ± 0  0 ❌ ±0  2 🔥 +1 
3 868 runs  +1 935  3 832 ✅ +1 916  30 💤 +15  3 ❌ +2  3 🔥 +2 

For more details on these errors, see this check.

Results for commit f657c8f. ± Comparison against base commit 157e2ef.

♻️ This comment has been updated with latest results.

When a new user signs up, they receive an initial daily credit grant.
Previously, the profile popover would immediately show "We topped up
your account to 2,000 credits since you were getting low", which is
confusing for users who haven't spent any credits yet.

Added a `dailyCreditGrantCount` field to the user endpoint that counts
how many daily_credit ledger entries exist. The "topped up" message is
now only shown when the count is greater than 1, meaning the daily cron
has actually topped up the user after they spent credits. Fresh users
with only the initial signup grant (count=1) will only see the
"Last daily credits grant" line.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jurgenwerk jurgenwerk force-pushed the cs-10292-when-new-user-signs-up-it-will-say-we-topped-up-your-account branch from a12c49e to c551cba Compare March 2, 2026 13:27
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jurgenwerk jurgenwerk changed the title Remove confusing 'topped up' message for new users Remove confusing 'getting low on credits' message for newly signed up users Mar 2, 2026
@jurgenwerk jurgenwerk requested a review from a team March 2, 2026 14:00
@habdelra habdelra requested a review from Copilot March 2, 2026 14:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the / _user endpoint and host UI copy/logic so newly signed-up users don’t see the misleading “since you were getting low” daily top-up message unless a real post-usage top-up occurred.

Changes:

  • Add dailyCreditGrantCount to the /_user response, derived from COUNT(*) of daily_credit ledger entries.
  • Update host UI messaging to only include “since you were getting low” when dailyCreditGrantCount > 1.
  • Extend server and host acceptance tests to cover the new field and messaging behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/billing/billing-queries.ts Replace single-timestamp query with combined “last grant + count” query for daily credits.
packages/realm-server/handlers/handle-fetch-user.ts Include dailyCreditGrantCount in /_user response attributes.
packages/realm-server/tests/realm-endpoints/user-test.ts Assert dailyCreditGrantCount across scenarios (no grants, one grant, multiple grants).
packages/realm-server/tests/server-endpoints/stripe-webhook-test.ts Update expected /_user payload to include dailyCreditGrantCount.
packages/host/app/services/billing-service.ts Parse and store dailyCreditGrantCount from /_user response.
packages/host/app/components/with-subscription-data.gts Gate the “getting low” clause on dailyCreditGrantCount > 1.
packages/host/tests/acceptance/operator-mode-acceptance-test.gts Add acceptance coverage for fresh user messaging (no “getting low” text).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jurgenwerk jurgenwerk merged commit 4d3acd7 into main Mar 3, 2026
126 of 131 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants