Automattic / wc-calypso-bridge

20 stars 4 forks source link

Avoid duplicate/unnecessary WooCommerce.com subscriptions for staging sites #1335

Closed daledupreez closed 11 months ago

daledupreez commented 1 year ago

Prerequisites

Describe the bug

Over the last few days, we became aware that we have been creating dedicated subscriptions on WooCommerce.com for staging sites created for ecommerce sites. This was leading to customer confusion, as they have been seeing duplicate subscriptions on WooCommerce.com, despite only having one live site. Furthermore, we haven't been cleaning up these subscriptions when staging sites have been removed, which exacerbates the problem, as some users may see multiple subscriptions if they create and then decommission a staging site multiple times.

Per the following discussion with the WooCommerce.com marketplace team, p1698137602111819/1698034733.903779-slack-C05D86F7G8Y, we don't need to perform the software registration for staging sites, as we only allow one staging site per live site.

Expected behavior

When a user who has a WordPress.com eCommerce/Commerce subscription or a Woo Express subscription on their site creates a staging site, they should continue to see their original subscriptions on WooCommerce.com.

Actual behavior

When a user who has a WordPress.com eCommerce/Commerce subscription or a Woo Express subscription on their site creates a staging site, they see subscriptions for both the live and staging sites on WooCommerce.com.

Steps to reproduce

  1. Create a site on WordPress.com with a Woo Express or Commerce plan subscription
  2. Go to Extensions -> Manage in the left nav, and make a note of the number of subscriptions you have
  3. Go to Settings -> Hosting Configuration in the left nav
  4. Click on the "Add staging site" to create a staging site
  5. Wait for the staging site to be created, which takes a little while.
  6. Once the staging site has been created, navigate back to Extensions -> Manage in the left nav.
  7. Click on the "Update" button next to the Subscriptions title towards the top of the page to refresh the data from WooCommerce.com.
  8. Verify that there has been a jump in the number of subscriptions on WordPress.com.

WordPress Environment

Not relevant for this issue -- this is an issue with our site provisioning code.

Isolating the problem

daledupreez commented 1 year ago

I also want to note that we have some number of sites where this has already occurred, and we have some gap in our site deprovisioning code that is not cancelling these subscriptions correctly.

sixhours commented 11 months ago

Started a fix in D128279-code

daledupreez commented 11 months ago

I am going to mark this issue as closed, as we shipped D128279-code to production on 2023-11-09.