Describe the bug
Ref. p5T066-14o-p2.
New Stats reverts to Old Stats when the wc-admin plugin is v0.22+. The API contains breaking changes.
To Reproduce
Steps to reproduce the behavior:
wc-admin plugin installed and updated to version 0.22. We have reverted to the old stats as we couldn’t find the WooCommerce Admin plugin error will appear.The app logs will read:
Dashboard (Order Stats) — Error synchronizing order stats v4: Dotcom Invalid REST Route
Error synchronizing order stats: Dotcom Invalid REST Route
Making a request through Postman, the API error will read:
{
"error": "rest_no_route",
"message": "No route was found matching the URL and request method"
}
This is happening due to a namespace change to the API rest route.
Screenshots
If applicable, add screenshots to help explain your problem.
Expected behavior
Check if the user is using the New Stats feature. Check if the user has an old version of wc-admin. If they are on an older version, display the message card (the one that invites users to try out the beta Stats) and say something like "Stats has been reverted to the non-beta version. To use the beta v4 stats please upgrade the wc-admin plugin to version v0.22 or higher." Correct the API rest routes to use the new namespace.
Notes: I'm not familiar with Stats implementation. Feel free to correct anything that's wrong with this bug report.
Isolating the problem (mark completed items with an [x]):
Mobile Environment
Please include:
Hey! Bumping this to 3.2, if you'd like to get it in for this release please merge any PRs for this into release/3.1 and then DM me to release a new Beta version.`
Hey @JavonDavis 👋. This task has to target the 3.1 branch when it's created, so I'm going to move it back to the 3.1 milestone. We'll be sure to ping you when the PR is merged in 🌟
@mindgraffiti Sorry for the mixup in the branch names, I've corrected this!
We'll be sure to ping you when the PR is merged in
Sounds good, thanks!
cc @jkmassel in case I'm not around to do it when it's ready
closing manually since the PR wasn't targeting develop
Most helpful comment
@mindgraffiti Sorry for the mixup in the branch names, I've corrected this!
Sounds good, thanks!
cc @jkmassel in case I'm not around to do it when it's ready