Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix subscription deletion when putting into unmanaged mode #3286

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

knolleary
Copy link
Member

Description

A regression was introduced in #3181 that meant when putting teams into unmanaged mode, we'd try to delete a subscription with an id of '' - not gonna happen.

This fixes that and improves the existing unit test to ensure the delete function is called with the expected subscription id.

@knolleary knolleary requested a review from Pezmc January 3, 2024 14:43
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (248b4f4) 40.71% compared to head (be510b7) 40.71%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3286   +/-   ##
=======================================
  Coverage   40.71%   40.71%           
=======================================
  Files         603      603           
  Lines       22546    22546           
  Branches     5450     5450           
=======================================
  Hits         9179     9179           
  Misses      13367    13367           
Flag Coverage Δ
backend 77.54% <100.00%> (ø)
frontend 2.01% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -546,7 +546,7 @@ module.exports.init = async function (app) {
// needed by closeSubscription. This is to ensure when the
// stripe callback arrives we don't trigger a suspension of
// the team resources.
await stripe.subscriptions.del(subscription.subscription, {
await stripe.subscriptions.del(existingSubscription, {
Copy link
Contributor

Choose a reason for hiding this comment

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

Easy to miss, I wouldn't expect subscription.subscription to be '' but indeed I see it on line 528 above:

subscription.subscription = ''

@knolleary knolleary merged commit a295288 into main Jan 4, 2024
7 checks passed
@knolleary knolleary deleted the 3285-fix-sub-deletion branch January 4, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Error canceling existing subscription XXX" when putting team into unmanaged billing mode
2 participants