Skip to content

fix(webapp): billing alert preview uses current limit instead of stale saved amount#4338

Draft
claude[bot] wants to merge 1 commit into
mainfrom
fix/billing-alert-preview-stale-limit
Draft

fix(webapp): billing alert preview uses current limit instead of stale saved amount#4338
claude[bot] wants to merge 1 commit into
mainfrom
fix/billing-alert-preview-stale-limit

Conversation

@claude

@claude claude Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Requested by Iss · Slack thread

Testing

Added a regression test in apps/webapp/test/billingAlertsFormat.test.ts covering the raised-limit scenario, and ran the billingAlertsFormat test suite (26 tests passing). The new test fails against the previous behavior (returns the stale 3000) and passes with the fix (returns the current 30000).

Before: After raising the billing limit, the alert threshold preview still showed dollar amounts calculated against the previous limit until the user clicked "Update alerts" again.

After: The preview reflects the current saved billing limit immediately.


Changelog

getAlertPreviewLimitCents no longer returns the alert record's snapshotted amount whenever saved percentage levels exist. It returns the snapshot only when it still matches the current effective/plan limit, and otherwise returns the current effectiveLimitCents, so the threshold preview follows the saved billing limit right away. Added a regression test.


Generated by Claude Code

…e saved amount

After a customer raised their billing limit, the alert-threshold percentage
preview kept calculating dollar amounts against the previous limit until they
re-saved their alerts. This happened because the preview reused the alert
record's snapshotted amount whenever saved percentage levels existed.

The preview now returns the snapshot only when it still matches the current
effective/plan limit, and otherwise falls back to the current effective limit,
so the preview reflects the saved billing limit immediately. Adds a regression
test covering the raised-limit scenario.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TywtuVBcXSNVTV6nJbgLk8
@changeset-bot

changeset-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 186a139

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

1 participant