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

[Security Solution][Detections] Alert table status update bug #87243

Merged
merged 3 commits into from
Jan 7, 2021

Conversation

dplumlee
Copy link
Contributor

@dplumlee dplumlee commented Jan 4, 2021

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.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios

For maintainers

@dplumlee dplumlee added bug Fixes for quality problems that affect the customer experience release_note:fix v8.0.0 v7.11.0 Team:Detections and Resp Security Detection Response Team Feature:Detection Alerts Security Solution Detection Alerts Feature labels Jan 4, 2021
@dplumlee dplumlee self-assigned this Jan 4, 2021
@@ -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>(
Copy link
Contributor Author

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.

@dplumlee dplumlee marked this pull request as ready for review January 5, 2021 22:43
@dplumlee dplumlee requested review from a team as code owners January 5, 2021 22:43
@dplumlee
Copy link
Contributor Author

dplumlee commented Jan 6, 2021

@elasticmachine merge upstream

@@ -90,6 +87,10 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps> = ({

const { addWarning } = useAppToasts();

const getAlertStatus = useCallback(() => {
Copy link
Contributor

@yctercero yctercero Jan 6, 2021

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?

Copy link
Contributor

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

Copy link
Contributor

@yctercero yctercero left a 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!

Copy link
Contributor

@banderror banderror left a 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(() => {
Copy link
Contributor

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

@dplumlee dplumlee force-pushed the alert-status-update-bug branch from e6bbf82 to bfe9bca Compare January 7, 2021 18:01
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 8.5MB 8.5MB -209.0B

History

  • 💛 Build #97172 was flaky e6bbf823ccdf9dabb6174c6445f0f52a582fa898
  • 💔 Build #97128 failed 9f4c8bc34484a9473048ce7a49db80ef80d82144
  • 💚 Build #96795 succeeded 151cde37e3de8010069c2266762c77a6956fb451

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Detection Alerts Security Solution Detection Alerts Feature release_note:fix Team:Detections and Resp Security Detection Response Team v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants