feat(billing): add orgRetention to Subscription type#103118
Conversation
| export type RetentionSettings = { | ||
| downsampled: number | null; | ||
| standard: number | null; | ||
| }; |
There was a problem hiding this comment.
Bug: Nullability Mismatch: Inconsistent Retention Type Definitions
The new RetentionSettings type defines standard: number | null, but BillingMetricHistory.retention at line 730 still uses an inline type with standard: number (non-nullable). This creates a type inconsistency where semantically similar retention fields have different nullability constraints, which could cause runtime errors when standard is null in contexts expecting the BillingMetricHistory type.
| downsampled: number | null; | ||
| standard: number | null; |
There was a problem hiding this comment.
can you confirm these two can both be null? i'm not seeing where in the serialization on the backend they could be null
There was a problem hiding this comment.
Good question. Yes both can be null, and if so they default to the plan item's retention policy.
I merged these 2 PRs last week that make the BMH.retention_days nullable:
There was a problem hiding this comment.
I made a linear project for it if you want to find out more
https://linear.app/getsentry/project/retention-settings-f26a1652b356/overview
This is a follow up to https://github.com/getsentry/getsentry/pull/18799 and https://github.com/getsentry/getsentry/pull/18800