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

[ResponseOps][Alerts] Fix stack alerts page table loading twice when filters load #183405

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

umbopepato
Copy link
Member

@umbopepato umbopepato commented May 14, 2024

Summary

Waits for the filter controls bar to load before triggering the alerts table loading.

Fixes #183412

To verify

  1. Open the Network DevTools tab, filter by Fetch/XHR and search bsearch
  2. Navigate to the Stack alerts page (Stack Management > Alerts)
  3. Verify visually that the table loads only once
  4. Verify that just one bsearch network request is performed

@umbopepato
Copy link
Member Author

/ci

@umbopepato umbopepato force-pushed the stack-alerts-page-double-loading-fix branch from 03c84a6 to 0a3ab92 Compare May 14, 2024 14:30
@umbopepato
Copy link
Member Author

/ci

@umbopepato umbopepato marked this pull request as ready for review May 15, 2024 11:17
@umbopepato umbopepato requested a review from a team as a code owner May 15, 2024 11:17
@umbopepato umbopepato changed the title [RAM] Fix stack alerts page table loading twice when filters load [ResponseOps][Alerts] Fix stack alerts page table loading twice when filters load May 15, 2024
@umbopepato umbopepato added release_note:fix Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.14.0 v8.15.0 labels May 15, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@kibana-ci
Copy link
Collaborator

💚 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 15.1MB 15.1MB +48.0B
triggersActionsUi 1.6MB 1.6MB +183.0B
total +231.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@adcoelho
Copy link
Contributor

I am not sure it is fixed @umbopepato 😞

If I am in Stack Management > Alerts and I refresh the page then the table only renders once and I only see one bsearch in the network tab.

But if I am anywhere else and navigate to Alerts by clicking the link in the sidebar, I still see the 2 renders and multiple bsearchs.

bug.mov

@@ -50,9 +59,11 @@ describe('StackAlertsPage', () => {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd replace this whole block by:

appMockRender.render(<StackAlertsPage />);

expect(await screen.findByTestId('stackAlertsPageContent')).toBeInTheDocument();
expect(await screen.findByTestId('urlSyncedAlertsSearchBar')).toBeInTheDocument();
expect(await screen.findByTestId('alertsTable')).toBeInTheDocument()

(the reference I Always use 😅 )

Copy link
Contributor

@JiaweiWu JiaweiWu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:fix Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.14.0 v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ResponseOps][Alerts] Stack alerts page table loads twice
5 participants