[Synthetics] Only return 404 if screenshot_ref is truly not present#215241
Merged
justinkambic merged 2 commits intoelastic:mainfrom Mar 24, 2025
Merged
Conversation
Contributor
|
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
|
Contributor
|
Starting backport for target branches: 9.0 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Mar 24, 2025
…elastic#215241) ## Summary Right now we return a 404 anytime that the data we're looking for on the `screenshot_ref` route is not satisfactory. We do an io-ts check on the data before returning. It's possible that that data will fail the check, and we'd return a 404 anyway. This isn't a very accurate reflection of what's happening on the server, and could indicate a problem with the user's data. Instead, we first check if the data returned from Elasticsearch is `null`, and if it is we return a 404. Otherwise, we compute the type check like normal and return the result. In the case where the data fails the type check, we instead return a 500 and include the malformed data in the server response. Co-authored-by: Faisal Kanout <faisal.kanout@elastic.co> (cherry picked from commit 74f87d9)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
JoseLuisGJ
pushed a commit
to JoseLuisGJ/kibana
that referenced
this pull request
Mar 24, 2025
…elastic#215241) ## Summary Right now we return a 404 anytime that the data we're looking for on the `screenshot_ref` route is not satisfactory. We do an io-ts check on the data before returning. It's possible that that data will fail the check, and we'd return a 404 anyway. This isn't a very accurate reflection of what's happening on the server, and could indicate a problem with the user's data. Instead, we first check if the data returned from Elasticsearch is `null`, and if it is we return a 404. Otherwise, we compute the type check like normal and return the result. In the case where the data fails the type check, we instead return a 500 and include the malformed data in the server response. Co-authored-by: Faisal Kanout <faisal.kanout@elastic.co>
kibanamachine
added a commit
that referenced
this pull request
Mar 24, 2025
…resent (#215241) (#215726) # Backport This will backport the following commits from `main` to `9.0`: - [[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)](#215241) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Justin Kambic","email":"jk@elastic.co"},"sourceCommit":{"committedDate":"2025-03-24T14:50:18Z","message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <faisal.kanout@elastic.co>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","Team:obs-ux-management","v9.1.0"],"title":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present","number":215241,"url":"https://github.com/elastic/kibana/pull/215241","mergeCommit":{"message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <faisal.kanout@elastic.co>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215241","number":215241,"mergeCommit":{"message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <faisal.kanout@elastic.co>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7"}}]}] BACKPORT--> Co-authored-by: Justin Kambic <jk@elastic.co>
cqliu1
pushed a commit
to cqliu1/kibana
that referenced
this pull request
Mar 31, 2025
…elastic#215241) ## Summary Right now we return a 404 anytime that the data we're looking for on the `screenshot_ref` route is not satisfactory. We do an io-ts check on the data before returning. It's possible that that data will fail the check, and we'd return a 404 anyway. This isn't a very accurate reflection of what's happening on the server, and could indicate a problem with the user's data. Instead, we first check if the data returned from Elasticsearch is `null`, and if it is we return a 404. Otherwise, we compute the type check like normal and return the result. In the case where the data fails the type check, we instead return a 500 and include the malformed data in the server response. Co-authored-by: Faisal Kanout <faisal.kanout@elastic.co>
Contributor
Author
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
justinkambic
added a commit
to justinkambic/kibana
that referenced
this pull request
Apr 14, 2025
…elastic#215241) ## Summary Right now we return a 404 anytime that the data we're looking for on the `screenshot_ref` route is not satisfactory. We do an io-ts check on the data before returning. It's possible that that data will fail the check, and we'd return a 404 anyway. This isn't a very accurate reflection of what's happening on the server, and could indicate a problem with the user's data. Instead, we first check if the data returned from Elasticsearch is `null`, and if it is we return a 404. Otherwise, we compute the type check like normal and return the result. In the case where the data fails the type check, we instead return a 500 and include the malformed data in the server response. Co-authored-by: Faisal Kanout <faisal.kanout@elastic.co> (cherry picked from commit 74f87d9)
justinkambic
added a commit
that referenced
this pull request
Apr 14, 2025
…resent (#215241) (#218136) # Backport This will backport the following commits from `main` to `8.x`: - [[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)](#215241) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Justin Kambic","email":"jk@elastic.co"},"sourceCommit":{"committedDate":"2025-03-24T14:50:18Z","message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <faisal.kanout@elastic.co>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","Team:obs-ux-management","v9.1.0"],"title":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present","number":215241,"url":"https://github.com/elastic/kibana/pull/215241","mergeCommit":{"message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <faisal.kanout@elastic.co>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/215726","number":215726,"state":"MERGED","mergeCommit":{"sha":"349e4472ee62edd72cd062bb2635cb563f61168b","message":"[9.0] [Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241) (#215726)\n\n# Backport\n\nThis will backport the following commits from `main` to `9.0`:\n- [[Synthetics] Only return 404 if `screenshot_ref` is truly not present\n(#215241)](https://github.com/elastic/kibana/pull/215241)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Justin Kambic <jk@elastic.co>"}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215241","number":215241,"mergeCommit":{"message":"[Synthetics] Only return 404 if `screenshot_ref` is truly not present (#215241)\n\n## Summary\n\nRight now we return a 404 anytime that the data we're looking for on the\n`screenshot_ref` route is not satisfactory. We do an io-ts check on the\ndata before returning. It's possible that that data will fail the check,\nand we'd return a 404 anyway. This isn't a very accurate reflection of\nwhat's happening on the server, and could indicate a problem with the\nuser's data.\n\nInstead, we first check if the data returned from Elasticsearch is\n`null`, and if it is we return a 404. Otherwise, we compute the type\ncheck like normal and return the result. In the case where the data\nfails the type check, we instead return a 500 and include the malformed\ndata in the server response.\n\nCo-authored-by: Faisal Kanout <faisal.kanout@elastic.co>","sha":"74f87d99bc1981a533982e103f802d0cbf118fa7"}}]}] BACKPORT-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Right now we return a 404 anytime that the data we're looking for on the
screenshot_refroute is not satisfactory. We do an io-ts check on the data before returning. It's possible that that data will fail the check, and we'd return a 404 anyway. This isn't a very accurate reflection of what's happening on the server, and could indicate a problem with the user's data.Instead, we first check if the data returned from Elasticsearch is
null, and if it is we return a 404. Otherwise, we compute the type check like normal and return the result. In the case where the data fails the type check, we instead return a 500 and include the malformed data in the server response.