-
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][Detections] Alert table status update bug #87243
Conversation
@@ -60,9 +60,6 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps> = ({ | |||
const dispatch = useDispatch(); | |||
const [, dispatchToaster] = useStateToaster(); | |||
const [isPopoverOpen, setPopover] = useState(false); | |||
const [alertStatus, setAlertStatus] = useState<Status | undefined>( |
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.
This useState was causing the render bug, and since we aren't actually utilizing the setAlertStatus
to do anything functional outside this component, I've changed it to always getting the alert status directly from the ECS data as it'll always be correct when rendered.
@elasticmachine merge upstream |
@@ -90,6 +87,10 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps> = ({ | |||
|
|||
const { addWarning } = useAppToasts(); | |||
|
|||
const getAlertStatus = 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.
Could this just be a useMemo
?
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.
++, but that's a nit
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! Pulled down and tested closing/opening alerts. Thanks!
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.
👍 Tested, works just fine! Thank you!
@@ -90,6 +87,10 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps> = ({ | |||
|
|||
const { addWarning } = useAppToasts(); | |||
|
|||
const getAlertStatus = 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.
++, but that's a nit
e6bbf82
to
bfe9bca
Compare
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
Addresses #85748
Fixes the case where alert status wouldn't get immediately updated (Opened, Closed, Made in-progress) when changed in the alerts table.
Video
alertStatusUpdateBug.mov
Checklist
Delete any items that are not applicable to this PR.
For maintainers