Skip to content

fix(billing): Null-guard invoice item data in checkout success - #129457

Open
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/checkout-success-null-item-data
Open

sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/checkout-success-null-item-data

Conversation

@sentry

@sentry sentry Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Fixes TypeError Cannot read properties of null (reading 'quantity') on /checkout/.

Problem

When customers migrated to the billing platform submit scheduled changes (e.g. downgrades or term renewals deferred to period end), /customers/{slug}/subscription/?expand=invoice returns 204 with no immediate invoice. The checkout success page displays scheduled changes using previewData.invoiceItems.

serialize_billing_platform_subscription_preview serializes invoice items with "data": null. ScheduledChanges in checkoutSuccess.tsx evaluates item.data.quantity ?? 0 for reserved volume line items, which throws a TypeError when data is null.

Fix

  • Optional chain item.data?.quantity ?? 0 at both reservedVolume.map call sites in checkoutSuccess.tsx.
  • Update BaseInvoiceItem.data type to allow null to reflect actual backend serialization.
  • Add optional chaining to purchasedPlanItem.data?.plan in views/amCheckout/index.tsx.
  • Add a unit test covering rendering scheduled changes when a reserved line item has data: null.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes JAVASCRIPT-3G4X

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@sentry
sentry Bot requested a review from a team as a code owner November 1, 2026 22:48
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 1, 2026

This branch was successfully deployed

1 active deployment
Preview — f2d0a4e2 Deployed Nov 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants