Skip to content

Conversation

@brendanhsentry
Copy link
Member

closes https://linear.app/getsentry/issue/RTC-1027/improve-copy-on-over-quota-banner-on-stats-page

  • Increase your Reserved Quotas banner if a category is exceeded usage
  • Upgrade to Business banner if subscription is not currently on a Business plan

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 26, 2025
@brendanhsentry brendanhsentry requested a review from a team June 26, 2025 21:21
@brendanhsentry brendanhsentry marked this pull request as ready for review June 26, 2025 21:21
@codecov
Copy link

codecov bot commented Jun 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #94493      +/-   ##
==========================================
- Coverage   87.92%   85.64%   -2.29%     
==========================================
  Files       10376    10376              
  Lines      601024   601024              
  Branches    23393    23393              
==========================================
- Hits       528472   514731   -13741     
- Misses      72085    85826   +13741     
  Partials      467      467              

@brendanhsentry brendanhsentry marked this pull request as draft June 26, 2025 21:38
@brendanhsentry brendanhsentry marked this pull request as ready for review June 26, 2025 23:03
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Null Categories Property Causes TypeError

The code attempts to call Object.values(subscription.categories) without checking if subscription.categories is defined. If subscription.categories is null or undefined, this will throw a TypeError. Subscriptions can exist without the categories property, making this a potential runtime error.

static/gsApp/utils/billing.tsx#L509-L512

// paid plans should add events without changing plans
const hasAnyUsageExceeded = Object.values(subscription.categories).some(
category => category.usageExceeded
);

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

@dashed dashed requested a review from Copilot June 27, 2025 19:05
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

This PR refines when the organization stats banner and usage alerts appear by requiring actual exceeded usage for paid plans and hiding banners for business plans without overages.

  • Added a check for usageExceeded in getBestActionToIncreaseEventLimits
  • Updated OrgStatsBanner to return null if no action text is provided
  • Extended and adjusted unit tests to cover new conditions

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
static/gsApp/views/subscriptionPage/usageAlert.spec.tsx Updated test description and added usageExceeded to fixture for the request CTA
static/gsApp/utils/billing.tsx Introduced hasAnyUsageExceeded guard and refined plan‐upgrade logic
static/gsApp/utils/billing.spec.tsx Added tests for business plan scenario in getBestActionToIncreaseEventLimits
static/gsApp/hooks/orgStatsBanner.tsx Early return null when no header/subtext is set
static/gsApp/hooks/orgStatsBanner.spec.tsx Added spec to assert no banner for business plan without exceeded usage
static/gsApp/components/gsBanner.spec.tsx Updated GSBanner spec to include usageExceeded flag
Comments suppressed due to low confidence (3)

static/gsApp/utils/billing.tsx:520

  • Returning an empty string to signal "no action" may be confusing and could break type safety. Consider returning undefined or introducing an explicit UsageAction.NONE enum value.
  return '';

static/gsApp/utils/billing.spec.tsx:943

  • We should add tests for the send_to_checkout and request_upgrade branches to cover scenarios where a paid non-business plan should upgrade, both with and without billing access.
    });

static/gsApp/views/subscriptionPage/usageAlert.spec.tsx:29

  • [nitpick] The test description could be clearer by stating "business plan with exceeded usage and without billing access" to match the fixture setup and emphasize the billing permissions check.
  it('renders request add events CTA if business, non-billing member, and usage exceeded', function () {

@brendanhsentry brendanhsentry merged commit e751ba7 into master Jun 30, 2025
46 checks passed
@brendanhsentry brendanhsentry deleted the brendan/orgStatsBanner-update-cta branch June 30, 2025 18:04
andrewshie-sentry pushed a commit that referenced this pull request Jul 14, 2025
closes
https://linear.app/getsentry/issue/RTC-1027/improve-copy-on-over-quota-banner-on-stats-page

- Increase your Reserved Quotas banner if a category is exceeded usage
- Upgrade to Business banner if subscription is not currently on a
Business plan
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants