Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug of HC historical results not showing top 20/30 #91

Merged
merged 1 commit into from
Sep 16, 2021

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Sep 15, 2021

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 entire AnomalyHeatmapChart 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 results

What's happening currently:
User selects "Top 20" -> props.onDisplayOptionChanged is called -> AnomalyHeatmapChart is re-mounted (so all hooks will be triggered) -> the hook on props.detectorTaskProgress is triggered -> resetting the selected option to "Top 10" -> only showing top 10 entity results

I created #90 to track this, and will handle separately.

Issues Resolved

[List any issues this PR will resolve]

Check List

  • Commits are signed per the DCO using --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.

Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
@ohltyler ohltyler added bug Something isn't working v1.1.0 Version 1.1.0 labels Sep 15, 2021
@ohltyler ohltyler merged commit 913be1b into opensearch-project:main Sep 16, 2021
ohltyler added a commit to ohltyler/anomaly-detection-dashboards-plugin-1 that referenced this pull request Sep 16, 2021
ohltyler added a commit to ohltyler/anomaly-detection-dashboards-plugin-1 that referenced this pull request Sep 16, 2021
ohltyler added a commit that referenced this pull request Sep 16, 2021
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
ohltyler added a commit that referenced this pull request Sep 16, 2021
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v1.1.0 Version 1.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants