Fixed cancelled subscriptions counting in multiple subscriptions warning#28507
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThis PR modifies how Ghost counts "active" Stripe customers by filtering subscriptions to exclude those marked for cancellation at period end. The core change adds a 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.43.0)ghost/core/test/e2e-api/admin/members.test.jsComment |
ref https://linear.app/ghost/issue/BER-3722/ - Stripe keeps a cancelled subscription's status as "active" until the end of its billing period, so members stayed in the multiple-active-subscriptions filter and warning banner even after their extra subscriptions had been cancelled - the filter now also requires cancel_at_period_end to be false, so cancelling an extra subscription immediately removes the member from the filter and banner count
9d6eb28 to
552282b
Compare
ref https://linear.app/ghost/issue/BER-3722/
The multiple-active-subscriptions members filter added in #28232 was returning too many members. Stripe keeps a cancelled subscription's status as
activeuntil the end of its billing period, so after a site owner contacted affected members and the extra subscriptions were cancelled, those members kept showing in the filter and the warning banner until their billing periods ended — making it look like the problem hadn't been resolved.The filter's subquery now also requires
cancel_at_period_endto be false, so a subscription that's running out its term after cancellation no longer counts as active. Cancelling an extra subscription immediately removes the member from the filter and the banner count.