Pre sync errors are not always cleared after successful sync #2737
Labels
priority: high
The issue/PR is high priority—it affects lots of customers substantially, but not critically.
type: bug
The issue is a confirmed bug.
Describe the bug:
If we encounter pre sync errors we store these in the product meta with the key
_wc_gla_errors
. These are mostly for validation issues before the product is sent to the Merchant Center. One such error is an empty description field.If we previously had these errors for specific products, we'd expect them to be cleared up after resolving the error and syncing the product. These issues are cleared up in the product edit view. But they continue to popup in the product issues table on the Product Feed page:
The reason this is not cleared up is because of a mismatch in synced countries with target countries. We can see this in the following code:
That's asking to fulfill two conditions:
Before v2 when this code was added, that was correct, because we were syncing each product individually for each target country. Later on that was refactored to only sync once for the base country, and include a list of target countries. However it seems this check wasn't refactored. So in case where there is only one target country it would still work, but if we have multiple target countries, it won't clear up old errors after a successful sync.
This went unnoticed in unit testing because the tests also remained the same to explicitly test the old scenarios:
In particular that second test needs to be changed to match the correct behaviour.
Workaround
One workaround to get around this issue is to follow these steps:
Steps to reproduce:
Expected behavior:
Local product errors to be cleared up after a successful sync
Actual behavior:
Clearing the product errors is skipped because the synced countries doesn't match the full list of target countries.
Additional details:
p1734476920010379-slack-C0410KV3YLW
The text was updated successfully, but these errors were encountered: