Skip to content

fix(notifications): Use plural form for QUOTA_SIZE_ANALYSIS enum value#107450

Merged
dashed merged 1 commit intomasterfrom
fix/quota-size-analysis-notification-type
Feb 2, 2026
Merged

fix(notifications): Use plural form for QUOTA_SIZE_ANALYSIS enum value#107450
dashed merged 1 commit intomasterfrom
fix/quota-size-analysis-notification-type

Conversation

@dashed
Copy link
Member

@dashed dashed commented Feb 2, 2026

Summary

Fixes 400 error when users try to update Size Analysis spend notification preferences via PUT /api/0/users/me/notification-options/.

The frontend dynamically generates notification field names in fields2.tsx using:

name: 'quota' + upperFirst(categoryInfo.plural)

For Size Analysis, categoryInfo.plural is 'sizeAnalyses' (from DataCategory.SIZE_ANALYSIS in static/app/types/core.tsx), producing quotaSizeAnalyses.

However, PR #106939 introduced the backend enum value as quotaSizeAnalysis (singular), causing a validation mismatch.

Changes:

  • Update NotificationSettingEnum.QUOTA_SIZE_ANALYSIS from "quotaSizeAnalysis" to "quotaSizeAnalyses"
  • Update corresponding test expectation

Test Plan

  • test_notification_defaults.py - 1 test passed
  • test_user_notification_settings_options.py - 8 tests passed
  • Pre-commit hooks passed

The frontend dynamically generates notification field names using
`'quota' + upperFirst(categoryInfo.plural)`, which produces
`quotaSizeAnalyses` based on `DataCategory.SIZE_ANALYSIS = 'sizeAnalyses'`.

The backend enum value was incorrectly set to `quotaSizeAnalysis`
(singular), causing 400 errors when users tried to update Size Analysis
spend notification preferences.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 2, 2026
@dashed dashed self-assigned this Feb 2, 2026
@dashed dashed requested a review from a team February 2, 2026 22:58
@dashed dashed marked this pull request as ready for review February 2, 2026 22:58
@dashed dashed requested review from a team as code owners February 2, 2026 22:58
Copy link
Member

@krithikravi krithikravi left a comment

Choose a reason for hiding this comment

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

there's a test failing but looks good otherwise

@dashed
Copy link
Member Author

dashed commented Feb 2, 2026

there's a test failing but looks good otherwise

We regenerate the openapi schema from the new changes. This breaking change is intentional.

@dashed dashed merged commit c084c2c into master Feb 2, 2026
72 of 73 checks passed
@dashed dashed deleted the fix/quota-size-analysis-notification-type branch February 2, 2026 23:28
shellmayr pushed a commit that referenced this pull request Feb 4, 2026
#107450)

## Summary

Fixes 400 error when users try to update Size Analysis spend
notification preferences via `PUT
/api/0/users/me/notification-options/`.

The frontend dynamically generates notification field names in
`fields2.tsx` using:
```javascript
name: 'quota' + upperFirst(categoryInfo.plural)
```

For Size Analysis, `categoryInfo.plural` is `'sizeAnalyses'` (from
`DataCategory.SIZE_ANALYSIS` in `static/app/types/core.tsx`), producing
`quotaSizeAnalyses`.

However, PR #106939 introduced the backend enum value as
`quotaSizeAnalysis` (singular), causing a validation mismatch.

**Changes:**
- Update `NotificationSettingEnum.QUOTA_SIZE_ANALYSIS` from
`"quotaSizeAnalysis"` to `"quotaSizeAnalyses"`
- Update corresponding test expectation

## Test Plan

- [x] `test_notification_defaults.py` - 1 test passed
- [x] `test_user_notification_settings_options.py` - 8 tests passed
- [x] Pre-commit hooks passed
jaydgoss pushed a commit that referenced this pull request Feb 12, 2026
#107450)

## Summary

Fixes 400 error when users try to update Size Analysis spend
notification preferences via `PUT
/api/0/users/me/notification-options/`.

The frontend dynamically generates notification field names in
`fields2.tsx` using:
```javascript
name: 'quota' + upperFirst(categoryInfo.plural)
```

For Size Analysis, `categoryInfo.plural` is `'sizeAnalyses'` (from
`DataCategory.SIZE_ANALYSIS` in `static/app/types/core.tsx`), producing
`quotaSizeAnalyses`.

However, PR #106939 introduced the backend enum value as
`quotaSizeAnalysis` (singular), causing a validation mismatch.

**Changes:**
- Update `NotificationSettingEnum.QUOTA_SIZE_ANALYSIS` from
`"quotaSizeAnalysis"` to `"quotaSizeAnalyses"`
- Update corresponding test expectation

## Test Plan

- [x] `test_notification_defaults.py` - 1 test passed
- [x] `test_user_notification_settings_options.py` - 8 tests passed
- [x] Pre-commit hooks passed
@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: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants