[ML] Fixes Anomaly Explorer Swimlane race condition, adds tests.#22814
Merged
walterra merged 15 commits intoelastic:masterfrom Sep 11, 2018
Merged
[ML] Fixes Anomaly Explorer Swimlane race condition, adds tests.#22814walterra merged 15 commits intoelastic:masterfrom
walterra merged 15 commits intoelastic:masterfrom
Conversation
Contributor
|
Pinging @elastic/ml-ui |
jgowdyelastic
approved these changes
Sep 7, 2018
Member
There was a problem hiding this comment.
nit, keys shouldn't be quoted
Member
There was a problem hiding this comment.
nit, this could be broken over a few lines to make it more readable
Contributor
💔 Build Failed |
Contributor
Author
|
retest |
Contributor
💔 Build Failed |
Contributor
💔 Build Failed |
1963c4e to
5d2addb
Compare
Contributor
💔 Build Failed |
…es while they are loading.
5d2addb to
7ae6643
Compare
Contributor
💔 Build Failed |
Contributor
Author
|
retest |
Contributor
💔 Build Failed |
Contributor
💔 Build Failed |
| // and avoid race conditions ending up with the wrong charts. | ||
| let lastRequestTime = null; | ||
| function loadDataForCharts(jobIds, influencers, earliestMs, latestMs) { | ||
| const requestTime = new Date().getTime(); |
Member
There was a problem hiding this comment.
i think lastRequestTime could just be a counter that is incremented on each call
Contributor
peteharverson
left a comment
There was a problem hiding this comment.
Tested your latest changes and all selection events in the swimlane are behaving correctly for me (tested on Chrome and Edge).
Contributor
💔 Build Failed |
Contributor
💔 Build Failed |
jgowdyelastic
approved these changes
Sep 11, 2018
| } | ||
|
|
||
| const newRequestCount = requestCount + 1; | ||
| requestCount = newRequestCount; |
Member
There was a problem hiding this comment.
nit, these two lines could be
const newRequestCount = ++requestCount;
Contributor
💚 Build Succeeded |
walterra
added a commit
to walterra/kibana
that referenced
this pull request
Sep 11, 2018
…stic#22814) This PR addresses parts of elastic#22642: - It gets rid of the use of var that = this;. - dragSelect's action strings are moved to a constants file. - Adds jest tests for the ExplorerSwimlane component. This also fixes the following bugs: - The way we subscribe listeners to the events of the dragSelect library could result in the same event being triggered multiple times. This in turn could cause race conditions when on each event new data gets fetched but in between angular's scope gets updated and could end up in a non-intended way. The result of this were view-by swimlanes not updating correctly or anomaly charts showing non-related charts. This PR fixes it by filtering out consecutive swimlane click events. - When the angular based chart container wrapper directive gets destroyed/re-esetup when using the job pick, it missed unmounting the react component, it didn't trigger componentWillUnmount()and didn't unsubscribe from dragSelectListener.
walterra
added a commit
that referenced
this pull request
Sep 11, 2018
) (#22923) This PR addresses parts of #22642: - It gets rid of the use of var that = this;. - dragSelect's action strings are moved to a constants file. - Adds jest tests for the ExplorerSwimlane component. This also fixes the following bugs: - The way we subscribe listeners to the events of the dragSelect library could result in the same event being triggered multiple times. This in turn could cause race conditions when on each event new data gets fetched but in between angular's scope gets updated and could end up in a non-intended way. The result of this were view-by swimlanes not updating correctly or anomaly charts showing non-related charts. This PR fixes it by filtering out consecutive swimlane click events. - When the angular based chart container wrapper directive gets destroyed/re-esetup when using the job pick, it missed unmounting the react component, it didn't trigger componentWillUnmount()and didn't unsubscribe from dragSelectListener.
This was referenced Sep 12, 2018
walterra
added a commit
that referenced
this pull request
Sep 13, 2018
- This fixes a regression introduced in #22814. The influencer list wouldn't update if no cell in the swimlanes was selected. - Renames getTopInfluencers to loadTopInfluencers to be in line with the other functions loadDataForCharts and loadAnomaliesTableData - Changes the order of arguments for loadDataForCharts so they are the same like in loadTopInfluencers.
walterra
added a commit
to walterra/kibana
that referenced
this pull request
Sep 13, 2018
- This fixes a regression introduced in elastic#22814. The influencer list wouldn't update if no cell in the swimlanes was selected. - Renames getTopInfluencers to loadTopInfluencers to be in line with the other functions loadDataForCharts and loadAnomaliesTableData - Changes the order of arguments for loadDataForCharts so they are the same like in loadTopInfluencers.
walterra
added a commit
that referenced
this pull request
Sep 13, 2018
…2989) - This fixes a regression introduced in #22814. The influencer list wouldn't update if no cell in the swimlanes was selected. - Renames getTopInfluencers to loadTopInfluencers to be in line with the other functions loadDataForCharts and loadAnomaliesTableData - Changes the order of arguments for loadDataForCharts so they are the same like in loadTopInfluencers.
walterra
added a commit
that referenced
this pull request
Sep 13, 2018
- Fixes a regression introduced in #22814. Because of the stricter checking for scope/props updates, resizing the browser window would miss updating the Anomaly Explorer Charts widths. This fixes it by adding a check to trigger anomalyDataChange in redrawOnResize(). - Additionally, if only one chart is up for display, this update makes sure a single chart always spans across the full available width.
walterra
added a commit
to walterra/kibana
that referenced
this pull request
Sep 13, 2018
- Fixes a regression introduced in elastic#22814. Because of the stricter checking for scope/props updates, resizing the browser window would miss updating the Anomaly Explorer Charts widths. This fixes it by adding a check to trigger anomalyDataChange in redrawOnResize(). - Additionally, if only one chart is up for display, this update makes sure a single chart always spans across the full available width.
walterra
added a commit
that referenced
this pull request
Sep 13, 2018
- Fixes a regression introduced in #22814. Because of the stricter checking for scope/props updates, resizing the browser window would miss updating the Anomaly Explorer Charts widths. This fixes it by adding a check to trigger anomalyDataChange in redrawOnResize(). - Additionally, if only one chart is up for display, this update makes sure a single chart always spans across the full available width.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #18344.
This PR addresses parts of #22642.
var that = this;.dragSelect's action strings are moved to a constants file.ExplorerSwimlanecomponent.Note for reviewers: The diff for
explorer_swimlane.jsis rather big - it's because I moved at lot of methods which were defined incomponentDidMount()likethis.fnName = ...to be methods on the class itself likefnName() { ... }, the methods themselves didn't change though.This also fixes the following bugs:
dragSelectlibrary could result in the same event being triggered multiple times. This in turn could cause race conditions when on each event new data gets fetched but in between angular's scope gets updated and could end up in a non-intended way. The result of this were view-by swimlanes not updating correctly or anomaly charts showing non-related charts. This PR fixes it by filtering out consecutive swimlane click events.componentWillUnmount()and didn't unsubscribe fromdragSelectListener.