Skip to content

Commit

Permalink
[Synthetics] Fix ping heatmap payload (elastic#195107)
Browse files Browse the repository at this point in the history
## Summary

We addressed elastic#180076 recently
with these two PRs:

- elastic#184177
- elastic#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 560d561)
  • Loading branch information
justinkambic committed Oct 8, 2024
1 parent e336077 commit 0e7e2ec
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const useMonitorStatusData = ({ from, to, initialSizeRef }: Props) => {

useDebounce(
async () => {
setDebouncedCount(binsAvailableByWidth);
setDebouncedCount(binsAvailableByWidth === 0 ? null : binsAvailableByWidth);
},
500,
[binsAvailableByWidth]
Expand Down

0 comments on commit 0e7e2ec

Please sign in to comment.