Woocommerce-ios: Stats v4 reverts to Stats v3 if `wc-admin` plugin is v0.22 or higher

Created on 18 Nov 2019  Â·  4Comments  Â·  Source: woocommerce/woocommerce-ios

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:

  1. On your test site, have the wc-admin plugin installed and updated to version 0.22.
  2. Visit your store on the mobile app. 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]):

  • [ ] I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • [x] This bug happens with a default WordPress theme active, or Storefront.
  • [x] I can reproduce this bug consistently using the steps above.

Mobile Environment
Please include:

  • Device: any
  • iOS version: any
  • WooCommerce iOS version: 3.0
  • wc-admin version: 0.22 and up
stats bug

Most helpful comment

@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

All 4 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mindgraffiti picture mindgraffiti  Â·  3Comments

juliaamosova picture juliaamosova  Â·  3Comments

eshurakov picture eshurakov  Â·  3Comments

jkmassel picture jkmassel  Â·  4Comments

webbbio picture webbbio  Â·  4Comments