mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] Ensure charts loaded in Anomaly Explorer match swimlane selection (#23690)
* Only consider last request.Prevent promise race condition * Reminder for regression test
This commit is contained in:
parent
57b4b144fc
commit
1311d89b24
1 changed files with 9 additions and 0 deletions
|
@ -48,7 +48,11 @@ export function explorerChartsContainerServiceFactory(
|
|||
|
||||
callback(getDefaultData());
|
||||
|
||||
let requestCount = 0;
|
||||
const anomalyDataChangeListener = function (anomalyRecords, earliestMs, latestMs) {
|
||||
const newRequestCount = ++requestCount;
|
||||
requestCount = newRequestCount;
|
||||
|
||||
const data = getDefaultData();
|
||||
|
||||
const threshold = mlSelectSeverityService.state.get('threshold');
|
||||
|
@ -265,6 +269,11 @@ export function explorerChartsContainerServiceFactory(
|
|||
|
||||
Promise.all(seriesPromises)
|
||||
.then(response => {
|
||||
// TODO: Add test to prevent this regression.
|
||||
// Ignore this response if it's returned by an out of date promise
|
||||
if (newRequestCount < requestCount) {
|
||||
return;
|
||||
}
|
||||
// calculate an overall min/max for all series
|
||||
const processedData = response.map(processChartData);
|
||||
const allDataPoints = _.reduce(processedData, (datapoints, series) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue