-
Notifications
You must be signed in to change notification settings - Fork 69
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 issues when the Stripe Billing is_migrating()
function would return false if the one of the actions was actively running
#7227
Fix issues when the Stripe Billing is_migrating()
function would return false if the one of the actions was actively running
#7227
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.41 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @james-allan for the quick fix.
I replicated the issue on trunk
and confirmed the notices are correct while a migration is in-progress on this branch.
LGTM 💯
Because the release branch is already opened. I think we'll need to:
- Merge this into
develop
- Cherry-pick the merge commit into
release/6.5.0
- Manually delete the changelog file from the release branch
…turn false if the one of the actions was actively running (#7227)
Changes proposed in this Pull Request
This PR fixes an issue I came across late last week after testing the Stripe Billing subscription migrator.
After I pressed the Begin migration button on the WooPayments Settings screen. I hit refresh a couple of minutes later and even though the migration hadn't finished yet, the Begin migration notice had returned.
After doing a deep dive I discovered it was because one of the
wcpay_migrate_subscription
actions had thein-progress
status (ie was actively running at the time the check was made) which causedas_next_scheduled_action()
returntrue
rather than a timestamp which caused theis_numeric()
checks inis_migrating()
to return false.This PR fixes that by making sure we check for
true
(is running) or an int (is scheduled).Testing instructions
sleep( 120 )
into theWC_Payments_Subscriptions_Migrator::get_items_to_repair()
function.develop
you should see the Begin migration notice appear. Despite the migration is still technically running.pending
orin-progress
.Video showcasing the bug:
https://github.com/Automattic/woocommerce-payments/assets/8490476/e75188cb-c202-4e6c-8bdf-bca0d18580db
You can also use this code snippet to observe the bug. When the action is
in-progress
, this will echotrue
on this branch andfalse
on develop.npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge