Uh oh!
There was an error while loading. Please reload this page.
fix(webapp): billing alert preview uses current limit instead of stale saved amount - #4338
fix(webapp): billing alert preview uses current limit instead of stale saved amount#4338claude[bot] wants to merge 1 commit into
Conversation
…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
|
Closing as superseded — this preview bug is already fixed on |
Requested by Iss · Slack thread
Testing
Added a regression test in
apps/webapp/test/billingAlertsFormat.test.tscovering the raised-limit scenario, and ran thebillingAlertsFormattest suite (26 tests passing). The new test fails against the previous behavior (returns the stale3000) and passes with the fix (returns the current30000).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
getAlertPreviewLimitCentsno longer returns the alert record's snapshottedamountwhenever saved percentage levels exist. It returns the snapshot only when it still matches the current effective/plan limit, and otherwise returns the currenteffectiveLimitCents, so the threshold preview follows the saved billing limit right away. Added a regression test.Generated by Claude Code