Skip to content

feat(notifications): Add Size Analysis to notification settings UI#106940

Merged
dashed merged 6 commits intomasterfrom
billing/BIL-2007
Feb 2, 2026
Merged

feat(notifications): Add Size Analysis to notification settings UI#106940
dashed merged 6 commits intomasterfrom
billing/BIL-2007

Conversation

@dashed
Copy link
Member

@dashed dashed commented Jan 25, 2026

closes https://linear.app/getsentry/issue/BIL-2007/add-size-analysis-to-notification-settings-ui-frontend

Summary

Enable the Size Analysis quota notification setting to appear in the user notification settings UI, gated behind the expose-category-size-analysis feature flag.

  • Set isBilledCategory: true for SIZE_ANALYSIS in DATA_CATEGORY_INFO
  • Add expose-category-size-analysis feature flag filtering in filterCategoryFields()
  • Gate quotaSizeAnalyses notification setting behind feature flag

Dependencies

  • Requires PR #106939 (BIL-1918) to be merged first

Test plan

  • Existing notification settings tests pass (18 tests)
  • Pre-commit checks pass
  • Manual verification that Size Analysis appears in notification settings only when feature flag is enabled

@linear
Copy link

linear bot commented Jan 25, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 25, 2026
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 26, 2026
@dashed dashed removed the Scope: Backend Automatically applied to PRs that change backend components label Jan 26, 2026
@getsentry getsentry deleted a comment from github-actions bot Jan 26, 2026
@dashed dashed self-assigned this Jan 26, 2026
@dashed dashed marked this pull request as ready for review January 26, 2026 22:14
@dashed dashed requested a review from a team as a code owner January 26, 2026 22:14
@dashed dashed requested a review from a team January 26, 2026 22:14
@dashed dashed removed the Scope: Backend Automatically applied to PRs that change backend components label Feb 2, 2026
@getsentry getsentry deleted a comment from github-actions bot Feb 2, 2026
- Set isBilledCategory: true for SIZE_ANALYSIS in DATA_CATEGORY_INFO
- Add expose-category-size-analysis feature flag filtering in filterCategoryFields()
- Gate quotaSizeAnalyses notification setting behind feature flag

Closes BIL-2007
…tions

Add the missing reservedSizeAnalyses property to all Reservations objects
to fix TypeScript compilation errors in CI. This property was added to the
Reservations type but was missing in several test files and implementation.

Fixes:
- productSelectionAvailability.spec.tsx
- productUnavailableCTA.spec.tsx
- usePreviewData.spec.tsx
- useUpgradeNowParams.tsx
…ctations

Update test expectations to include the reservedSizeAnalyses property
that was added to the Reservations type in the implementation.
…frontend

The backend notification setting used singular form `quotaSizeAnalysis`
but the frontend DataCategory convention generates plural form
`quotaSizeAnalyses`. This mismatch caused the Size Analysis notification
setting to be non-functional.

Changed backend from `quotaSizeAnalysis` to `quotaSizeAnalyses` to match
the frontend convention and be consistent with similar settings like
`quotaSeerUsers`.
…xture

The am2Plans fixture returns sizeAnalyses with events: 100, so the test
expectations should be 100, not undefined.
… RPC API

The change from `quotaSizeAnalysis` to `quotaSizeAnalyses` was flagged
as a breaking change by the openapi-diff CI check since the production
RPC schema already contains the original value. Reverted to maintain
backwards compatibility.
@dashed dashed enabled auto-merge (squash) February 2, 2026 15:41
@dashed dashed merged commit 927d8a8 into master Feb 2, 2026
56 checks passed
@dashed dashed deleted the billing/BIL-2007 branch February 2, 2026 15:48
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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

}
if (field.name.startsWith('quotaSizeAnalysis') && !includeSizeAnalysis) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Feature flag filter uses wrong field name spelling

High Severity

The filter checks for field.name.startsWith('quotaSizeAnalysis') (singular spelling with 'i'), but the actual field name generated in fields2.tsx is quotaSizeAnalyses (plural spelling with 'e'). Since "analyses" doesn't start with "analysis" (they differ at the 'e' vs 'i'), this filter will never match. The Size Analysis notification setting will appear for all users regardless of the expose-category-size-analysis feature flag being enabled.

Fix in Cursor Fix in Web

dashed added a commit that referenced this pull request Feb 2, 2026
## Summary

Fixes a bug introduced in PR #106940 where the Size Analysis
notification setting was appearing for all users regardless of the
`expose-category-size-analysis` feature flag.

The issue was a typo in the feature flag filter:
- Filter checked for `quotaSizeAnalysis` (singular, with 'i')
- Actual field name is `quotaSizeAnalyses` (plural, with 'e')

Since `'quotaSizeAnalyses'.startsWith('quotaSizeAnalysis')` returns
`false`, the filter never matched.

Simplified the filter to `quotaSize` to prevent similar typos in the
future.

## Test plan

- [x] Existing notification settings tests pass (13 tests)
- [x] Pre-commit hooks pass
Comment on lines +253 to +255
if (field.name.startsWith('quotaSizeAnalysis') && !includeSizeAnalysis) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: The frontend generates the field name 'quotaSizeAnalyses' (plural) for the Size Analysis notification, but the backend expects 'quotaSizeAnalysis' (singular), causing save attempts to fail.
Severity: MEDIUM

Suggested Fix

Align the frontend and backend field names. Either update the backend's NotificationSettingEnum in types.py to accept the plural form 'quotaSizeAnalyses', or change the frontend's field name generation in fields2.tsx to produce the singular form 'quotaSizeAnalysis'. Given the history, ensure the chosen fix does not break backward compatibility with the RPC API.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location:
static/app/views/settings/account/notifications/notificationSettingsByType.tsx#L253-L255

Potential issue: There is a mismatch between the frontend and backend for the Size
Analysis notification setting's field name. The frontend generates the field name as
`'quotaSizeAnalyses'` based on the `plural` property of the data category. However, the
backend's `NotificationSettingEnum` only recognizes the singular form,
`'quotaSizeAnalysis'`. When a user attempts to save this setting, the frontend sends the
pluralized name, which the backend's `validate_type()` function rejects, resulting in a
validation error. This makes the Size Analysis notification setting visible but
unsaveable in the UI.

shellmayr pushed a commit that referenced this pull request Feb 4, 2026
…106940)

closes
https://linear.app/getsentry/issue/BIL-2007/add-size-analysis-to-notification-settings-ui-frontend

## Summary

Enable the Size Analysis quota notification setting to appear in the
user notification settings UI, gated behind the
`expose-category-size-analysis` feature flag.

- Set `isBilledCategory: true` for SIZE_ANALYSIS in `DATA_CATEGORY_INFO`
- Add `expose-category-size-analysis` feature flag filtering in
`filterCategoryFields()`
- Gate `quotaSizeAnalyses` notification setting behind feature flag

## Dependencies

- Requires [PR #106939](#106939)
(BIL-1918) to be merged first

## Test plan

- [x] Existing notification settings tests pass (18 tests)
- [x] Pre-commit checks pass
- [ ] Manual verification that Size Analysis appears in notification
settings only when feature flag is enabled
shellmayr pushed a commit that referenced this pull request Feb 4, 2026
## Summary

Fixes a bug introduced in PR #106940 where the Size Analysis
notification setting was appearing for all users regardless of the
`expose-category-size-analysis` feature flag.

The issue was a typo in the feature flag filter:
- Filter checked for `quotaSizeAnalysis` (singular, with 'i')
- Actual field name is `quotaSizeAnalyses` (plural, with 'e')

Since `'quotaSizeAnalyses'.startsWith('quotaSizeAnalysis')` returns
`false`, the filter never matched.

Simplified the filter to `quotaSize` to prevent similar typos in the
future.

## Test plan

- [x] Existing notification settings tests pass (13 tests)
- [x] Pre-commit hooks pass
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 2026
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.

2 participants