-
Notifications
You must be signed in to change notification settings - Fork 8.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
[Security solution] Stops page from crashing when there is a fields error in the stackBy component #168411
Conversation
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
}, [allFields, useLensCompatibleFields]); | ||
return useMemo(() => stackByFieldOptions, [stackByFieldOptions]); | ||
|
||
return useCallback(() => { |
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.
useCallback
so this does not run right away, just when called
try { | ||
return getAggregatableFields(getAllFieldsByName(browserFields), useLensCompatibleFields); | ||
} catch (err) { | ||
addError(err, { |
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.
@paulewing what do you think of this message? Looks like:
x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.test.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.test.tsx
Outdated
Show resolved
Hide resolved
Thanks for adding this fix, @stephmilovic 🎉 |
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
…rror in the stackBy component (elastic#168411)
Summary
Resolves #149540
We've been seeing SDHs reporting a stack overflow error that breaks the page.
The error points to a valid problem, but we wanted to improve the Alerts page UX to prevent the app to crash in these situations, making the application more resilient and showing some meaningful message to the customer when this happens.
Testing
Start by running local es from a snapshot and local kibana. Unless you want to edit some paths in scripts the best way to do this is to run kibana with a base path and defining that base path to be
kbn
by adding this line to yourkibana.dev.yml
:@e40pud created a super helpful script for generating indices with huge amounts of fields: https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/mappings
Using Huge Indices tool, cd into the directory
x-pack/plugins/security_solution/scripts/mappings
and run the following commands:filebeat-
so the index will become part of our Security Data View without changes to the advanced settingsNow check the overview page. You should see our new error coming up. If you check out main, you will see the crash.
Before
After