Skip to content

fix(billing): Enforce Seer auto-reload minimums in the modal - #130828

Open
billyvg wants to merge 2 commits into
masterfrom
billyvong/reveng-733-auto-reload-modal-allows-0-daily-limit
Open

billyvg wants to merge 2 commits into
masterfrom
billyvong/reveng-733-auto-reload-modal-allows-0-daily-limit

Conversation

@billyvg

@billyvg billyvg commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Why?

The Seer auto-load modal didn't enforce the agreed limits: a minimum amount of $15, no $0 daily limit, and an unset daily limit meaning no cap. It let any amount above $0 through. Clearing the daily limit sent $0, which blocks all Seer usage, and there was no way to leave the limit unset.

The "Due now" preview also disagreed with the backend at exactly the threshold. The modal showed no charge, but the backend bills a load at or below the threshold. A new wallet starts at exactly the threshold, so turning auto-load on billed without showing "Due now".

How?

The modal reads the minimum amount and daily limit from the auto-load API instead of hardcoding them. It disables saving below either minimum and shows an inline message. An empty daily limit is saved as null, meaning no limit. The "Due now" preview now uses at-or-below the threshold, which matches when the backend bills the first load. The modal and wallet card now say auto-load triggers "at or below" the threshold rather than "below".

This depends on getsentry/getsentry#23167, which returns minTopUpCredits, minDailySpendCapCents and a nullable dailySpendCapCents. That change must deploy first.

Fixes REVENG-751

Generated with Claude Code

@linear-code

linear-code Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

REVENG-733

REVENG-751

@billyvg
billyvg marked this pull request as ready for review November 11, 2026 23:23
@billyvg
billyvg requested a review from a team as a code owner November 11, 2026 23:23
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-ia6viwz5m.sentry.dev

The auto-load modal let any amount above $0 through, sent a $0 daily
limit when the field was empty (which blocks all Seer usage), and had no
way to leave the daily limit unset.

The modal now reads the minimum amount and daily limit from the API,
disables saving below them with an inline message, and saves an empty
daily limit as no limit. The "Due now" charge preview matches the
backend, which loads credits at or below the threshold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@billyvg
billyvg force-pushed the billyvong/reveng-733-auto-reload-modal-allows-0-daily-limit branch from b59cd85 to d27a4a6 Compare November 12, 2026 01:07
The backend loads credits once the balance is at or below the threshold,
but the modal and wallet card said "below", so a wallet at exactly the
threshold being charged on turn-on looked like a bug.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@billyvg

billyvg commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

QA

I tested this on a box devserver, running this branch's frontend with getsentry/getsentry#23167's backend. The org is a local mock org on a token-billed (am3_business_seer_credits) contract, with 500 of 500 included credits. That is exactly the 500-credit threshold, the state from REVENG-751. The "before" frames come from master (b1ed56cb6fe) on the same backend and data.

Before After
Turning on at the threshold Turn-on modal before: no Due now, plain Turn on, daily limit $0 Turn-on modal after: Due now $15.00, Turn on and pay $15.00 + tax, daily limit No limit
$14 amount, $0 daily limit Before: $14 and $0 accepted, Turn on enabled After: inline errors for both fields, button disabled
Wallet card, auto-load on Wallet card before: when below 500 Wallet card after: when at or below 500
  • Turning on at the threshold: Before, the modal said "drop below $5" and showed a plain "Turn on", but the backend bills $15 as soon as auto-load is on at this balance. It now says "at or below $5", shows "Due now $15.00", and the button reads "Turn on and pay $15.00 + tax". An unset daily limit shows "No limit" instead of $0.
  • Minimums: A $14 amount and a $0 daily limit used to be accepted. They now show inline errors and disable the button. Clearing the daily limit removes its error and re-enables the button; I checked that in the DOM.
  • Not covered: clicking "Turn on and pay" (off-cycle invoices are off locally, so the charge can't go through), dark theme, and narrow viewports. The "auto-load on" config was written straight through SeerWalletConfigService, because turning it on through the API would bill.

Generated with Claude Code

This branch was successfully deployed

1 active deployment
Preview — 33a40ce9 Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant