-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(querying): Use appropriate HTTP status for async queries #21175
Conversation
Size Change: 0 B Total Size: 824 kB ℹ️ View Unchanged
|
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing after merge:
Mhm... the reasoning here was that the GET/retrieve call mostly successfully retrieves the status of the async query.
Imagine as frontend, you are querying the status, get 200 means you got the status, then checking whether the query erred is on a different level. Returning a bad request or server errors means we cannot distinguish from the "get status" failing vs. the actual query having failed.
Was there no way to look into the error inside the status instead?
I agree what you're describing definitely makes sense as one way of handling status @webjunkie Here the immediate issue is that all of our pre-existing API request code has handling for HTTP errors, so by reusing that, we can avoid that new handling to also check the query status body. |
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Problem
In the experimental async queries system, we were always returning a 200 even if things went wrong, and we were unsafely always returning the error when things went wrong. Related to ZEN-12040
Changes
We now use HTTP status codes appropriately, and are more deliberate with errors.
How did you test this code?
Updated API tests.