You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using <form use:enhance> to send an enhanced form action request, client-side fetch is used to request data from SvelteKit that currently is always returned with status code 200 even when return fail(400, {}) is used.
This is problematic when trying to track responses with a status of 400 (for example) using observability tools like Sentry.
Describe the proposed solution
Have the HTTP status code in a form action response match the status code of either return {} (200 or 204), or match the status code returned from fail().
This way, I can more easily track which user received which status code using observability tools. Due to the change in behaviour, I'd consider this a breaking change to SvelteKit if we proceed.
Alternatives considered
Manually log responses client-side based on response.status in use:enhance.
Describe the problem
When using
<form use:enhance>
to send an enhanced form action request, client-sidefetch
is used to request data from SvelteKit that currently is always returned with status code200
even whenreturn fail(400, {})
is used.This is problematic when trying to track responses with a status of
400
(for example) using observability tools like Sentry.Describe the proposed solution
Have the HTTP status code in a form action response match the status code of either
return {}
(200
or204
), or match the status code returned fromfail()
.This way, I can more easily track which user received which status code using observability tools. Due to the change in behaviour, I'd consider this a breaking change to SvelteKit if we proceed.
Alternatives considered
Manually log responses client-side based on
response.status
inuse:enhance
.Importance
would make my life easier
Additional Information
Continued from: #7233 (comment)
The text was updated successfully, but these errors were encountered: