woocommerce / google-listings-and-ads

Sync your store with Google to list products for free, run paid ads, and track performance straight from your store dashboard.
https://woo.com/products/google-listings-and-ads/
GNU General Public License v3.0
45 stars 21 forks source link

Display body message if error status is 406 during account creation #2505

Closed martynmjones closed 3 weeks ago

martynmjones commented 1 month ago

Changes proposed in this Pull Request:

For merchants who have created more than 20 Ads accounts via the connect server we want to display a more detailed error message and direct them to contact support for help. This PR adjusts the error handling so that if the server returns 406 status then we display the error message as it's received.

Screenshots:

Screenshot 2024-08-06 at 21 05 33

Detailed test instructions:


When reviewing this PR, please review https://github.com/Automattic/woocommerce-connect-server/pull/2554 at the same time.


  1. Run a local instance of the connect server using the branch in https://github.com/Automattic/woocommerce-connect-server/pull/2554
  2. Connect a local GLA test site to that connect server
  3. Update the local connect server config and set the google ads account limit to 0
  4. On your local GLA test site, go through onboarding and attempt to create a new Google Ads account
  5. Confirm the error message reads Error creating account: Account creation limit reached. Contact support for help.

Changelog entry

Tweak - Display additional context in error message when Google Ads account limit reached

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 63.8%. Comparing base (a8e9cac) to head (f772909). Report is 68 commits behind head on develop.

Files Patch % Lines
js/src/hooks/useUpsertAdsAccount.js 0.0% 3 Missing and 1 partial :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2505/graphs/tree.svg?width=650&height=150&src=pr&token=UROWUPF1LX&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce)](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2505?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) ```diff @@ Coverage Diff @@ ## develop #2505 +/- ## ============================================ - Coverage 64.7% 63.8% -0.8% ============================================ Files 797 326 -471 Lines 22930 5089 -17841 Branches 1220 1232 +12 ============================================ - Hits 14825 3247 -11578 + Misses 7938 1674 -6264 - Partials 167 168 +1 ``` | [Flag](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2505/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | Coverage Δ | | |---|---|---| | [js-unit-tests](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2505/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | `63.8% <0.0%> (+0.3%)` | :arrow_up: | | [php-unit-tests](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2505/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2505?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | Coverage Δ | | |---|---|---| | [js/src/hooks/useUpsertAdsAccount.js](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2505?src=pr&el=tree&filepath=js%2Fsrc%2Fhooks%2FuseUpsertAdsAccount.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce#diff-anMvc3JjL2hvb2tzL3VzZVVwc2VydEFkc0FjY291bnQuanM=) | `50.0% <0.0%> (-8.8%)` | :arrow_down: | ... and [481 files with indirect coverage changes](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2505/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce)