-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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(slo): preview data no response error #167909
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Pinging @elastic/actionable-observability (Team: Actionable Observability) |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @kdelemme |
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.
LGTM!
assertNever(type); | ||
} | ||
} catch (err) { | ||
return []; |
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.
nit: Showing a toast with the error message would help to understand no data is due to an error.
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
(cherry picked from commit 59257db)
# Backport This will backport the following commits from `main` to `8.11`: - [fix(slo): preview data no response error (#167909)](#167909) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kevin Delemme","email":"kevin.delemme@elastic.co"},"sourceCommit":{"committedDate":"2023-10-05T13:20:09Z","message":"fix(slo): preview data no response error (#167909)","sha":"59257dbcc8fcf2f05b9ac62cb4a494213afa75cd","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team: Actionable Observability","backport:prev-minor","Feature:SLO","v8.12.0"],"number":167909,"url":"https://github.com/elastic/kibana/pull/167909","mergeCommit":{"message":"fix(slo): preview data no response error (#167909)","sha":"59257dbcc8fcf2f05b9ac62cb4a494213afa75cd"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/167909","number":167909,"mergeCommit":{"message":"fix(slo): preview data no response error (#167909)","sha":"59257dbcc8fcf2f05b9ac62cb4a494213afa75cd"}}]}] BACKPORT--> Co-authored-by: Kevin Delemme <kevin.delemme@elastic.co>
Resolves #167854
🍒 Summary
When the preview API was failing and returning a no data body, the react hook was interpreting the response as an empty string, resulting in a breaking page.
This PR addresses this issue by always returning an empty response in case of runtime error from the API, and also check the response is an Array from the hook, before returning it to the component.