Fix bug of HC historical results not showing top 20/30 #91
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Tyler Ohlsen ohltyler@amazon.com
Description
Fixes the bug of the filters for "Top 20" / "Top 30" not updating correctly when selected for historical high-cardinality charts. The fix is to update the hook to use any existing filter state, rather than defaulting to "Top 10" and overriding any existing state.
Note that if the hook was working as expected, this original bug wouldn't exist, since it would only be triggered when changes to the
props.detectorTaskProgress
happen (when the historical task is running). But, it is actually being triggered when any filter selection is made. It was then found that the entireAnomalyHeatmapChart
component is getting re-mounted whenever these filter changes are occurring, hence triggering this hook every time a re-mount happens.Expected behavior:
User selects "Top 20" ->
props.onDisplayOptionChanged
is called ->AnomalyHeatmapChart
component re-renders with updated set of anomalies and entity data -> renders top 20 entity resultsWhat's happening currently:
User selects "Top 20" ->
props.onDisplayOptionChanged
is called ->AnomalyHeatmapChart
is re-mounted (so all hooks will be triggered) -> the hook onprops.detectorTaskProgress
is triggered -> resetting the selected option to "Top 10" -> only showing top 10 entity resultsI created #90 to track this, and will handle separately.
Issues Resolved
[List any issues this PR will resolve]
Check List
--signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.