Repository navigation
Fix global search crash on missing tag - #159196
Merged
Merged
Conversation
…x-nav-search-crash
Contributor
Author
|
@elasticmachine merge upstream |
Dosant
marked this pull request as ready for review
June 7, 2023 12:55
Contributor
|
Pinging @elastic/appex-sharedux (Team:SharedUX) |
tsullivan
approved these changes
Jun 7, 2023
tsullivan
left a comment
Member
There was a problem hiding this comment.
LGTM. I left a small note about updating the unit test, but I won't block merge because of it.
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@tsullivan, I didn't see the note |
Contributor
Author
|
@elasticmachine merge upstream |
tsullivan
reviewed
Jun 8, 2023
Comment on lines
+111
to
+126
| const option = resultToOption(input, [], getTag); | ||
| expect(option.append).toMatchInlineSnapshot(` | ||
| <ResultTagList | ||
| searchTagIds={Array []} | ||
| tags={ | ||
| Array [ | ||
| Object { | ||
| "color": "#000000", | ||
| "description": "Known", | ||
| "id": "known", | ||
| "name": "Known", | ||
| }, | ||
| ] | ||
| } | ||
| /> | ||
| `); |
Member
There was a problem hiding this comment.
I suggest adding a spy on the console to verify the message that is logged:
const logSpy = jest.spyOn(console, 'warn').mockImplementation(() => {}); // added
const option = resultToOption(input, [], getTag); // current code
// ... more current code
expect(logSpy).toBeCalledWith(
'SearchBar: Tag with id "unknown" not found. Tag "unknown" is referenced by the search result "dashboard:id". Skipping displaying the missing tag.'
); // added…/kibana into d/2023-06-07-fix-nav-search-crash
…x-nav-search-crash
💚 Build Succeeded
Metrics [docs]Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jun 9, 2023
## Summary Close elastic#157682, elastic#159152 Fixes global search component crashing on the missing tag. Ideally this should never happen as data is inconsistent, but we also shouldn't just crash the component. Adds a console warning in case hitting this edge case. (cherry picked from commit aa4a5e5)
kibanamachine
added a commit
that referenced
this pull request
Jun 9, 2023
# Backport This will backport the following commits from `main` to `8.8`: - [Fix global search crash on missing tag (#159196)](#159196) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Anton Dosov","email":"anton.dosov@elastic.co"},"sourceCommit":{"committedDate":"2023-06-09T10:27:41Z","message":"Fix global search crash on missing tag (#159196)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/157682,\r\nhttps://github.com/elastic/kibana/issues/159152\r\n\r\nFixes global search component crashing on the missing tag. Ideally this\r\nshould never happen as data is inconsistent, but we also shouldn't just\r\ncrash the component.\r\n\r\nAdds a console warning in case hitting this edge case.","sha":"aa4a5e5cc4459be3929f02d63ebb679448a531bd","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Navigational Search","Team:SharedUX","backport:prev-minor","v8.9.0"],"number":159196,"url":"https://github.com/elastic/kibana/pull/159196","mergeCommit":{"message":"Fix global search crash on missing tag (#159196)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/157682,\r\nhttps://github.com/elastic/kibana/issues/159152\r\n\r\nFixes global search component crashing on the missing tag. Ideally this\r\nshould never happen as data is inconsistent, but we also shouldn't just\r\ncrash the component.\r\n\r\nAdds a console warning in case hitting this edge case.","sha":"aa4a5e5cc4459be3929f02d63ebb679448a531bd"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159196","number":159196,"mergeCommit":{"message":"Fix global search crash on missing tag (#159196)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/157682,\r\nhttps://github.com/elastic/kibana/issues/159152\r\n\r\nFixes global search component crashing on the missing tag. Ideally this\r\nshould never happen as data is inconsistent, but we also shouldn't just\r\ncrash the component.\r\n\r\nAdds a console warning in case hitting this edge case.","sha":"aa4a5e5cc4459be3929f02d63ebb679448a531bd"}}]}] BACKPORT--> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
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
Close #157682, #159152
Fixes global search component crashing on missing tag. Ideally this should never happen as data is inconsistent, but we also shouldn't just crash the component.
Adds a console warning in case hitting this edge case.