From 636d17c11157282abb736e6a16cfc2c4189a9b69 Mon Sep 17 00:00:00 2001 From: jjaychen <31304335+jjaychen1e@users.noreply.github.com> Date: Thu, 10 Oct 2024 17:02:33 +0800 Subject: [PATCH] PanelQueryRunner: Fix diff between multiple errors (#89868) --- public/app/features/query/state/PanelQueryRunner.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/app/features/query/state/PanelQueryRunner.ts b/public/app/features/query/state/PanelQueryRunner.ts index 87bb9bf93f5..8853a9945a2 100644 --- a/public/app/features/query/state/PanelQueryRunner.ts +++ b/public/app/features/query/state/PanelQueryRunner.ts @@ -1,4 +1,4 @@ -import { cloneDeep, merge } from 'lodash'; +import { cloneDeep, merge, isEqual } from 'lodash'; import { Observable, of, ReplaySubject, Unsubscribable } from 'rxjs'; import { map, mergeMap, catchError } from 'rxjs/operators'; @@ -371,6 +371,7 @@ export class PanelQueryRunner { let sameSeries = compareArrayValues(last.series ?? [], next.series ?? [], (a, b) => a === b); let sameAnnotations = compareArrayValues(last.annotations ?? [], next.annotations ?? [], (a, b) => a === b); let sameState = last.state === next.state; + let sameErrors = compareArrayValues(last.errors ?? [], next.errors ?? [], (a, b) => isEqual(a, b)); if (sameSeries) { next.series = last.series; @@ -380,7 +381,7 @@ export class PanelQueryRunner { next.annotations = last.annotations; } - if (sameSeries && sameAnnotations && sameState) { + if (sameSeries && sameAnnotations && sameState && sameErrors) { return; } }