Skip to content

Conversation

@panteliselef
Copy link
Member

@panteliselef panteliselef commented Sep 2, 2025

Description

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • Refactor
    • Standardized webhook event names to camelCase: subscription.pastDue and subscriptionItem.pastDue (previously past_due). Update any webhook listeners or filters accordingly.
  • Chores
    • Prepared a minor release under the Billing Beta scope.

@changeset-bot
Copy link

changeset-bot bot commented Sep 2, 2025

🦋 Changeset detected

Latest commit: d070b76

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

This PR includes changesets to release 11 packages
Name Type
@clerk/backend Minor
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/remix 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

@vercel
Copy link

vercel bot commented Sep 2, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Sep 2, 2025 3:44pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 2, 2025

Walkthrough

Renames two webhook event literal strings from snake_case to camelCase in backend TypeScript types: subscription.past_due → subscription.pastDue and subscriptionItem.past_due → subscriptionItem.pastDue. Adds a changeset documenting a minor version bump and Billing Beta scope. No structural code changes beyond type literal updates.

Changes

Cohort / File(s) Summary
Webhook event literal updates
packages/backend/src/api/resources/Webhooks.ts
Renamed allowed event literals: subscription.past_due → subscription.pastDue in CommerceSubscriptionWebhookEvent; subscriptionItem.past_due → subscriptionItem.pastDue in CommerceSubscriptionItemWebhookEvent.
Release notes / changeset
.changeset/four-mice-crash.md
Adds changeset for minor version, noting camelCase event name updates for past-due events.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my ears at past_due’s cue,
Now pastDue hops in shiny hue.
Two tiny ticks, the names align,
Webhooks squeak in camel spine.
I stamp a changelog, thump-thump—done!
Onward to versions, hop to run. 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch elef/fix-wrong-billing-event-name

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 2, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6687

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6687

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6687

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6687

@clerk/upgrade

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

@clerk/vue

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

commit: d070b76

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.changeset/four-mice-crash.md (1)

5-8: Polish wording and add a brief migration hint.

Minor grammar nit and a short note can help devs scanning release notes.

-[Billing Beta] Use correct casing for past due events types.
+[Billing Beta] Use correct casing for past-due event types.
 
 - `'subscription.past_due'` -> `'subscription.pastDue'`
 - `'subscriptionItem.past_due'` -> `'subscriptionItem.pastDue'`
+
+Note: If you previously matched on the snake_case literals, update your handlers/guards to use the camelCase variants.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5e94f0a and d070b76.

📒 Files selected for processing (2)
  • .changeset/four-mice-crash.md (1 hunks)
  • packages/backend/src/api/resources/Webhooks.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/four-mice-crash.md
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/backend/src/api/resources/Webhooks.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/backend/src/api/resources/Webhooks.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/backend/src/api/resources/Webhooks.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/backend/src/api/resources/Webhooks.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/backend/src/api/resources/Webhooks.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/backend/src/api/resources/Webhooks.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/backend/src/api/resources/Webhooks.ts (2)

87-88: Correct event literal: subscriptionItem.pastDue. LGTM.


74-76: Approve: correct event literal ‘subscription.pastDue’
Verified no remaining snake_case usages across code, tests, or docs; LGTM.

@panteliselef panteliselef merged commit c1049f0 into main Sep 2, 2025
40 checks passed
@panteliselef panteliselef deleted the elef/fix-wrong-billing-event-name branch September 2, 2025 16:21
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.

4 participants