pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.06k stars 265 forks source link

[Pods 2.8 Bug] Network requests never end if they fail on Edit Pod screen #6133

Closed sc0ttkclark closed 2 years ago

sc0ttkclark commented 2 years ago

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.

zrothauser commented 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