Skip to content

[9.3] [Security Solution] fix alerts page infinite loading state due to data view error (#256983)#257020

Merged
kibanamachine merged 1 commit intoelastic:9.3from
kibanamachine:backport/9.3/pr-256983
Mar 11, 2026
Merged

[9.3] [Security Solution] fix alerts page infinite loading state due to data view error (#256983)#257020
kibanamachine merged 1 commit intoelastic:9.3from
kibanamachine:backport/9.3/pr-256983

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.3:

Questions ?

Please refer to the Backport tool documentation

…a view error (elastic#256983)

## Summary

This PR fixed an issue that we've had for a while now with the new data
view manager logic.

> [!WARNING]
> This PR should not introduce any logic changes or visual changes
(other than the added toast when we encounter errors

### Reason

Some customer see an issue with the alerts page stuck in an infinite
loading state. The issue happens because something is failing within the
platform dataview service, which we rely on. In our code, we were
wrapping the entire logic of data view initialization within a
`try/catch`. When the error was happening in the dataview service, we
would not complete the initialization of all dataview, and some of them
were staying in a `pristine` status, instead of being changed to `error`
or `ready`, which is what the different pages (including the alerts
page) is expecting

### Fix

We're performing 2 types of fixes:
- we're not using the `getAllDataViewLazy` function dataview service
anymore as it has some code that communicates with the saved object
client, and we noticed some of our customers having errors with
conflicting ids in their saved objects, which triggered the flow
mentioned above. Instead we're leveraging the `getAllDataViewLazy`
function from the dataview service, which returns from the cache.
- we're wrapping everywhere we use the `get` function from the dataview
service with a `try/catch` to prevent other potential issue
- we're adding a UI toast to all those places to let the user know about
the error, which will facilitate debugging for us if this was to happen
again

> [!NOTE]
> We're trying to make this available in `9.2.7`, we'll be doing a
follow up PR shortly for other try catches we found in the
`detection_engine` folder

## What/How to test

- add data to a local instance and navigate through the app
- make sure the happy path works
  - load main the Security Solution pages
  - alerts page
  - timeline
  - analyzer
- verify interaction with new spaces

### Checklist
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

(cherry picked from commit 9b762ae)
@kibanamachine kibanamachine merged commit 4c588e2 into elastic:9.3 Mar 11, 2026
19 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 10.8MB 10.8MB +1.1KB

cc @PhilippeOberti

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants