Skip to content

Conversation

@jacekradko
Copy link
Member

@jacekradko jacekradko commented Jan 29, 2026

Description

Updates period_end to allow null in BillingSubscriptionItemWebhookEventJSON.

Previously, the API returned a negative timestamp for subscription items on the free plan. Now it returns null instead, which is a cleaner representation.

This aligns the webhook event type with the existing BillingSubscriptionItemJSON type which already allows null.

Checklist

  • pnpm build passes
  • Type is consistent with other period_end definitions in the codebase

References

Fixes: USER-4434

Summary by CodeRabbit

  • Bug Fixes
    • Updated billing webhook event structure to properly allow null values for period end dates, ensuring more accurate handling of billing subscription data.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jan 29, 2026 3:59pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: 610c3cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@clerk/backend Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

This pull request updates the BillingSubscriptionItemWebhookEventJSON interface in the backend package to modify the period_end field behavior. Previously, period_end was an optional field that accepted number values. It is now a required field that accepts either a number or null. This change ensures the field is always present in webhook events while allowing null as an explicit value instead of undefined.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The pull request directly addresses USER-4434 by updating the period_end field to allow null instead of returning negative timestamps.
Out of Scope Changes check ✅ Passed All changes are scoped to the stated objective: updating period_end in BillingSubscriptionItemWebhookEventJSON and adding the changeset file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The pull request title accurately summarizes the main change: allowing null values for the period_end field in billing subscription item webhooks, which is the core modification shown in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 29, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7699

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7699

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7699

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7699

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7699

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7699

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@7699

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7699

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7699

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7699

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7699

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7699

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7699

@clerk/react

npm i https://pkg.pr.new/@clerk/react@7699

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7699

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7699

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7699

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7699

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@7699

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7699

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7699

commit: 610c3cd

@jacekradko jacekradko requested a review from dstaley January 29, 2026 16:04
@jacekradko jacekradko changed the title fix(backend): allow null for period_end in BillingSubscriptionItemWebhookEventJSON fix(backend): Allow null for period_end in billing subscription item webhook Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants