Closed sc0ttkclark closed 2 years ago
This only applies if the error is due to an invalid nonce.
The retry comes from the WP core api-fetch
wrapper around fetch
:
https://github.com/WordPress/gutenberg/blob/trunk/packages/api-fetch/src/index.js#L172-L185
When a network request is made from the Edit Pod screen, and if it fails, it keeps retrying. It never stops retrying.
I'm not sure if this is limited to the Delete Field network request or not.
I had my test site open over the past couple of days and then I went to refresh the page and start to manage the fields on a pod. I then deleted a few fields but then noticed the Save Pod button wasn't working either. The network responses from the delete fields appear to continue forever (after failure, it just runs again):
{"code":"rest_cookie_invalid_nonce","message":"Cookie check failed","data":{"status":403}}
This request along with the
admin-ajax.php?action=rest-nonce
appear one after the other.I'm not sure what caused my REST nonces to be busted since I have done a complete page refresh and my auth is still valid -- but we should at least stop the forever-requests. Max retries should be maybe 3, if those fail then throw a notice onto the screen about a failed save/delete.