Skip to content

[7.7] [SIEM] Prevent undefined behavior in our ML popover (#62498)#62525

Merged
rylnd merged 1 commit intoelastic:7.7from
rylnd:backport/7.7/pr-62498
Apr 3, 2020
Merged

[7.7] [SIEM] Prevent undefined behavior in our ML popover (#62498)#62525
rylnd merged 1 commit intoelastic:7.7from
rylnd:backport/7.7/pr-62498

Conversation

@rylnd
Copy link
Copy Markdown
Contributor

@rylnd rylnd commented Apr 3, 2020

Backports the following commits to 7.7:

* Moves enableDataFeed outside of MLPopover

If we accept our dispatch functions, enableDatafeed can be abstracted as
a pure function. The version bound to popover's dispatch functions is
now named 'handleJobStateChange', as that is the callback it's used for.

* Remove unused component state

We no longer deal with jobs in our local state; that's the
responsibility of the useSiemJobs hook

* Prevent user from initiating multiple job installations

When attempting to run a job from the ML Popover, if the job needs to
first be installed, we set the rest of the jobs to be "loading" while
installation is performed.

Without this change, if users are fast enough they can potentially
trigger multiple rule installations, which is undefined behavior and
leads to failures and bad state in our component.

* Remove unused import
@rylnd rylnd added the backport This PR is a backport of another PR label Apr 3, 2020
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

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

@rylnd rylnd merged commit ef649b8 into elastic:7.7 Apr 3, 2020
@rylnd rylnd deleted the backport/7.7/pr-62498 branch April 3, 2020 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants