Skip to content
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

[Discover] Catch potental missing meta of filter #129183

Merged
merged 5 commits into from
Apr 11, 2022

Conversation

kertal
Copy link
Member

@kertal kertal commented Apr 1, 2022

Summary

The issue of #126464 (broken filter object led to an exception when no data was found) was discovered in 7.15.1 and was not reproducible in recent Kibana version (>= 7.17). However, looking at the code that failed due to a broken filter object missing the meta property, this PR improves the functionality that led to the problem in #126464. So, just in case Discover retrieves a broken Filter object again, it won't fail.

Fixes #126464

Testing

There's no known way to manually test this, since AFAIK the problem with broken Filters no longer exists, so there's a unit test responsible for testing.

Checklist

@kertal kertal self-assigned this Apr 1, 2022
@kertal kertal added ci:deploy-cloud Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Apr 1, 2022
@kertal
Copy link
Member Author

kertal commented Apr 1, 2022

@elasticmachine merge upstream

@kertal kertal changed the title [Discover] Catch potental missing feta of filter [Discover] Catch potental missing meta of filter Apr 5, 2022
@kertal kertal added the v8.3.0 label Apr 11, 2022
@kertal kertal marked this pull request as ready for review April 11, 2022 07:29
@kertal kertal requested a review from a team as a code owner April 11, 2022 07:29
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@kertal kertal requested a review from dimaanj April 11, 2022 07:30
@kertal kertal added the release_note:skip Skip the PR/issue when compiling release notes label Apr 11, 2022
Comment on lines +46 to +50
test('broken filter - edge case', () => {
const filters = [testFilterBroken];
const result = hasActiveFilter(filters);
expect(result).toBe(true);
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the test that actually would the original issue of having a broken filter object

@kertal kertal requested a review from jughosta April 11, 2022 07:50
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
discover 444 445 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 400.4KB 400.4KB +50.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @kertal

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing and adding tests!

@kertal kertal added the backport:skip This commit does not require backporting label Apr 11, 2022
@kertal kertal merged commit 73fb70b into elastic:main Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting :DataDiscovery/fix-it-week Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redirect Service - Cannot read properties of undefined
5 participants