[PR #5819] [MERGED] fix(stripe): return updated subscription in onSubscriptionUpdate callback #6249

Closed
opened 2026-03-13 12:52:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5819
Author: @bytaesu
Created: 11/7/2025
Status: Merged
Merged: 11/11/2025
Merged by: @Bekacru

Base: canaryHead: 2025-11-07/fix/stripe-updated-subscription


📝 Commits (3)

  • 8ceff38 fix(stripe): return updated subscription in onSubscriptionUpdate callback
  • 8a807af test: add test case for updated subscription in onSubscriptionUpdate
  • 1a80a6e Merge branch 'canary' into 2025-11-07/fix/stripe-updated-subscription

📊 Changes

2 files changed (+109 additions, -2 deletions)

View changed files

📝 packages/stripe/src/hooks.ts (+2 -2)
📝 packages/stripe/src/stripe.test.ts (+107 -0)

📄 Description

Closes https://github.com/better-auth/better-auth/issues/5560


Summary by cubic

Ensures onSubscriptionUpdate receives the freshly updated subscription from the database after a Stripe subscription change. Fixes callbacks seeing stale data like old seat counts.

  • Bug Fixes
    • Return the result of adapter.update and pass it to onSubscriptionUpdate (fallback to original if unavailable).
    • Added a test that updates seats (1 → 5) and asserts the callback and DB both reflect the new value.

Written for commit 1a80a6e57f. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5819 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 11/7/2025 **Status:** ✅ Merged **Merged:** 11/11/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `2025-11-07/fix/stripe-updated-subscription` --- ### 📝 Commits (3) - [`8ceff38`](https://github.com/better-auth/better-auth/commit/8ceff38285eb87b0651f14192c6eb9df1611a417) fix(stripe): return updated subscription in onSubscriptionUpdate callback - [`8a807af`](https://github.com/better-auth/better-auth/commit/8a807af47ebed99c2b1675378641b58b6bd3cbbf) test: add test case for updated subscription in onSubscriptionUpdate - [`1a80a6e`](https://github.com/better-auth/better-auth/commit/1a80a6e57f95b5ba99b1898efa565945b42d9536) Merge branch 'canary' into 2025-11-07/fix/stripe-updated-subscription ### 📊 Changes **2 files changed** (+109 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/stripe/src/hooks.ts` (+2 -2) 📝 `packages/stripe/src/stripe.test.ts` (+107 -0) </details> ### 📄 Description Closes https://github.com/better-auth/better-auth/issues/5560 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Ensures onSubscriptionUpdate receives the freshly updated subscription from the database after a Stripe subscription change. Fixes callbacks seeing stale data like old seat counts. - **Bug Fixes** - Return the result of adapter.update and pass it to onSubscriptionUpdate (fallback to original if unavailable). - Added a test that updates seats (1 → 5) and asserts the callback and DB both reflect the new value. <sup>Written for commit 1a80a6e57f95b5ba99b1898efa565945b42d9536. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:52:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#6249