Closed joashrajin closed 1 year ago
2023/03/27 00:52:01:851 ⛔️ Error synchronizing products: typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a dictionary instead.", underlyingError: nil))
This is generally a plugin conflict: A plugin alters the expected return type of one of the properties from models in core ( possibly the Products model in this case ) and returns a dictionary of "something" where the API is expecting an array of "something".
Other examples of a similar issue are:
Can you check with them if the same happens when they do a plugin dance? Taking a quick look to their SSR I'd say possible culprits could be Code Snippets: by Code Snippets Pro – 3.3.0
, Variation Swatches for WooCommerce: by CartFlows – 1.0.7
, or YITH WooCommerce Ajax Product Filter: by YITH – 4.20.0
. I'm seeing the Product model expects variations to be an array of Int64's, so could be the 2nd plugin on that list, as alters variations directly 🤔
Thanks, @iamgabrielma :)
I have reached out to the user
We have another case in 6177741-zd-woothemes. The common plugin I saw is FiboSearch - AJAX Search for WooCommerce
.
From the REST API response for products on this site, it was enclosed in an additional data
dictionary. So the response looks like this:
{
"data": [
{
"id": 66697,
...
]
}
Edited to add:
It appears that responses returned from the Jetpack will be enclosed in the data
field. Whereas responses returned from WC REST API don't have it. So, it might be another field that's causing this issue.
Also, apart from the FiboSearch - AJAX Search for WooCommerce
plugin, I found out the other common plugin for these sites are Yoast SEO
.
Another report in 6182091-zd-woothemes, mentioned the issue after updating the app to 12.8. I requested the user to perform a plugin conflict test.
List of active plugins on the site:
Advanced Local Pickup for WooCommerce: by zorem - 1.5.3
Akismet Anti-Spam: by Automattic - 5.1
Astra Pro: by Brainstorm Force - 4.1.4
Premium Starter Templates: by Brainstorm Force - 3.2.0
Product Feed Manager for WooCommerce: by RexTheme - 7.2.30
Code Snippets: by Code Snippets Pro - 3.3.0
Disable XML-RPC-API: by Neatma - 2.1.4.7
Elementor: by Elementor.com - 3.12.1
Facebook for WooCommerce: by Facebook - 3.0.17
Flying Scripts: by WP Speed Matters - 1.2.3
Forminator Pro: by WPMU DEV - 1.23.2
Site Kit by Google: by Google - 1.96.0
HookMeUp – Unlock and use strategic spots in any WooCommerce Theme: by Get Bowtied - 1.8
WPCode Lite: by WPCode - 2.0.9
Jetpack: by Automattic - 12.0
Mailchimp for WooCommerce: by Mailchimp - 2.8.2
Pinterest for WooCommerce: by WooCommerce - 1.2.17
Route App: by Route - 2.2.4
SVG Support: by Benbodhi - 2.5.5
Ultimate Addons for Elementor: by Brainstorm Force - 1.36.15
Variation Swatches for WooCommerce: by CartFlows - 1.0.7
USPS Simple Shipping for Woocommerce: by dangoodman - 1.8.2
WooCommerce Stripe Gateway: by WooCommerce - 7.2.0
PDF Invoices & Packing Slips for WooCommerce: by WP Overnight - 3.5.0
WooCommerce Shipping & Tax: by WooCommerce - 2.2.4
WooCommerce: by Automattic - 7.5.1
WordPress Importer: by wordpressdotorg - 0.8
Yoast SEO: by Team Yoast - 20.4
Defender Pro: by WPMU DEV - 3.10.0
Hummingbird Pro: by WPMU DEV - 3.4.5
WP Mail SMTP: by WPForms - 3.7.0
Smush Pro: by WPMU DEV - 3.12.6
WPMU DEV Dashboard: by WPMU DEV - 4.11.18
WPS Hide Login: by WPServeur, NicolasKulka, wpformation - 1.9.8
XPS Ship Integration: by XPS Ship - 1.1.72
@joashrajin @reginabally I'm working on adding some fallbacks to the app so we can try to handle unexpected data caused by plugin conflicts like this. Unfortunately, the errors messages mentioned in this issue are too generic to know exactly what the problem was for these merchants. We released a fix for that in version 13.3 (see #9510 and pe5sF9-1my-p2) so from those versions onward we should have more specific decoding error messages again.
I checked the stores in these user reports and it looks like they are either resolved (no errors that I see with decoding) or Jetpack is no longer connected so we can't check again. If you think it's appropriate, could you follow up with these merchants and see if they are still having any problems using the app, with version 13.3 or later? If so, the app logs should contain the more specific error message.
I'm going to go ahead and close this issue as I don't think there's anything more for us to do with the information we have here. If you do get reports of decoding errors like this from these or other merchants, please do open a new issue (a separate issue for different errors would be great for tracking/resolving them) and we can look into trying to prevent those errors. Thanks!
Describe the bug
We have a case reported in 6074239-zd-woothemes that we could not reproduce where the app was unable to load any products. In the app logs, we notice:
To Reproduce:
Isolating the problem (mark completed items with an [x]):
Mobile Environment Please include:
WordPress Environment