refreshAfterException property
Should we refresh the product data after an exception?
We need to refresh the product when the upload is successful, in order to retrieve the latest data, including the changes. But in some cases, we also need to refresh if the upload failed. The typical use-case is when the local product_type is incorrect. That means calling the wrong server for write operations, and that always fails. If we refresh the product from the server, we get the correct product type, and therefore the correct server to call. We refresh the product AFTER a failing "upload", so that the NEXT occurrence of the same background task takes the correct product type into account.
Some background tasks never care about the product type, and can return false.
Implementation
@protected
bool get refreshAfterException => true;