Replies: 1 comment 3 replies
-
Ok let me lay the reasoning out here. Actions are meant to imitate old MPA style POST -> redirect -> GET pattern. So generally even if the POST fails it needs to show something, either by redirecting to an error page or using a Flash message. In a sense useSubmission doubles as a Flash message. And when JS is turned off it is, reading from cookies. In so an action can only really return 2 things, the flash message and the ability to tell the browser where to go next (even if it is back at the page that instantiated the original request). So trying to figure out what HTTP codes mean in this context is tricky because generally you'd always return a redirect unless like the server crashed. At minimum the json helper should accept revalidate key so that it can turn off revalidation. Beyond that I'm not sure. |
Beta Was this translation helpful? Give feedback.
-
At the moment, all actions are returning
200
, so even when the request failed, the clients need to check the response body.Such failed responses seem to invalidate all queries on the page also, which is wasteful.
Maybe returning custom
Response
should be fully supported?For the
useSubmission
, I would rely on what existing solutions are doing already, exposingerror
,failureReason
Beta Was this translation helpful? Give feedback.
All reactions