[ML] Fix flaky job selection on the Anomaly Explorer page (#137596) (#137669)

This commit is contained in:
Kibana Machine 2022-08-01 06:20:26 -04:00 committed by GitHub
parent 38bfc539a3
commit 811f178a9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -6,7 +6,7 @@
*/
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
import { distinctUntilChanged, map, shareReplay, skipWhile } from 'rxjs/operators';
import { distinctUntilChanged, map, shareReplay, filter } from 'rxjs/operators';
import { isEqual } from 'lodash';
import type { ExplorerJob } from './explorer_utils';
import type { InfluencersFilterQuery } from '../../../common/types/es_client';
@ -68,7 +68,7 @@ export class AnomalyExplorerCommonStateService extends StateService {
public getSelectedJobs$(): Observable<ExplorerJob[]> {
return this._selectedJobs$.pipe(
skipWhile((v) => !v || !v.length),
filter((v) => Array.isArray(v) && v.length > 0),
distinctUntilChanged(isEqual),
shareReplay(1)
);

View file

@ -224,7 +224,7 @@ export class AnomalyTimelineStateService extends StateService {
switchMap(([selectedJobs, severity, bucketInterval]) => {
return from(
this.anomalyTimelineService.loadOverallData(
selectedJobs!,
selectedJobs,
undefined,
bucketInterval!,
severity