From ddbdd0bdd3e48a173a9c5f09c41e77215b60f3a6 Mon Sep 17 00:00:00 2001 From: neptunian Date: Thu, 17 Jun 2021 15:38:34 -0400 Subject: [PATCH] add comment --- x-pack/plugins/monitoring/server/lib/alerts/fetch_status.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_status.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_status.ts index 620f32014dae6ee..a7b24571307446b 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_status.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_status.ts @@ -49,7 +49,9 @@ export async function fetchStatus( if (!states) { return result; } - + // puts all alert states associated with this rule into a flat array. this works with both the legacy alert + // of having multiple alert states per alert, each representing a firing node, and the current alert where each firing + // node is an alert with a single alert state, the node itself. https://github.com/elastic/kibana/pull/102544 result.states = Object.values(states).reduce((accum: CommonAlertState[], instance: any) => { const alertInstanceState = instance.state as AlertInstanceState; if (!alertInstanceState.alertStates) {