From 0e7e2ecdbb9d68203cf552b2a0d02f83156393e5 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Tue, 8 Oct 2024 10:46:30 -0400 Subject: [PATCH] [Synthetics] Fix ping heatmap payload (#195107) ## Summary We addressed https://github.com/elastic/kibana/issues/180076 recently with these two PRs: - https://github.com/elastic/kibana/pull/184177 - https://github.com/elastic/kibana/pull/192508 We were seeing a strange error that was difficult to repro, so we put in a best-effort patch that was still ineffective. The reason this issue happens is because in the code it's possible to divide by 0, which yields a value of `Infinity`, which at some point causes our interval value supplied to the server route to be an empty string. This patch will make it so that we never pass a value of 0 to be used in the calculation of bucket sizes in this hook. (cherry picked from commit 560d561e21fe51020954bd9e3246f238ffa026ba) --- .../monitor_details/monitor_status/use_monitor_status_data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.ts index efb001f1776b7f7..8eaa80fb44a53de 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.ts +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.ts @@ -93,7 +93,7 @@ export const useMonitorStatusData = ({ from, to, initialSizeRef }: Props) => { useDebounce( async () => { - setDebouncedCount(binsAvailableByWidth); + setDebouncedCount(binsAvailableByWidth === 0 ? null : binsAvailableByWidth); }, 500, [binsAvailableByWidth]