forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Entity Analytics] Prevent multiple duplicated calls to index_status …
…API on alert details page (elastic#176573) ## Summary When checking if we are using the new or old risk engine, we use `useIsNewRiskScoreModuleInstalled`, this uses the risk engine status API. We were previously defaulting to returning false while the request was loading, this would then cause us to make API calls for the old indices index status, then the new ones once the API request comes back. The fix is to add a loading state to the hook and wait for loading to finish before proceeding, this seems to also prevent a few re-renders which was triggering the hook multiple times, making it so we only call the APIs once for each index (hosts and users) **Steps to reproduce:** Open an alert, and expand details with network tab open, note how many calls there are to the index_status API and to which indices. ### **Before, 14 API calls, most of which to legacy indices 😢** <img width="968" alt="Screenshot 2024-02-09 at 09 39 20" src="https://github.com/elastic/kibana/assets/3315046/e3943ce2-5cf2-4034-a9fa-189015eccae8"> ### **After, 2 API calls to the new indices 😍** <img width="716" alt="Screenshot 2024-02-09 at 09 39 53" src="https://github.com/elastic/kibana/assets/3315046/596ff183-395b-434c-8cb0-a97a49fe067d"> --------- Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
7e3a9f8
commit c7c7bc2
Showing
12 changed files
with
102 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters