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

Navigating to "Recently viewed" is not working for dashboards when the user comes from the Security solution #166686

Closed
teresaalvarezsoler opened this issue Sep 19, 2023 · 12 comments
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Dashboard Dashboard related features fixed impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team v8.11.0
Projects

Comments

@teresaalvarezsoler
Copy link

Kibana version: 8.9 but probably in older versions too

Browser: Chrome

Describe the bug:
When users are located in any of the Security UIs and they click on a recently viewed dashboard from the left bar navigation menu, they get redirected to the dashboard list instead of the dashboard clicked.

This is not happening from other solution UIs (observbability or search) or with other SOs (lens, maps, etc.)

Steps to reproduce:

  1. Go to any Security solution UI
  2. Open left side navigation menu
  3. Click in a recently viewed dashboard
  4. You get redirected to the dashboard listing page

Expected behavior:
Users should be redirected to the dashboard they clicked.

bug-recently-viewed2

Screenshots (if relevant):

@teresaalvarezsoler teresaalvarezsoler added bug Fixes for quality problems that affect the customer experience Feature:Dashboard Dashboard related features Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas labels Sep 19, 2023
@kibanamachine kibanamachine added loe:needs-research This issue requires some research before it can be worked on or estimated impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Sep 19, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@kibanamachine kibanamachine added this to Inbox in Dashboard Sep 19, 2023
@jsanz
Copy link
Member

jsanz commented Sep 19, 2023

I can confirm on a cloud 8.10.0 cluster. Nothing pops up on the browser dev console (on firefox 117.0.1 (64-bit))

@Heenawter
Copy link
Contributor

Heenawter commented Sep 19, 2023

This seems to be related to the Dashboard app's locator - the same thing happens when I add a links panel to the security dashboard. Rather than navigating to the specified dashboard in the Dashboard app, I get redirected to the listing page:

Screen.Recording.2023-09-19.at.7.56.36.AM.mov

I can most likely look into this as part of #164748

@teresaalvarezsoler
Copy link
Author

Thanks @Heenawter !

@Heenawter
Copy link
Contributor

Heenawter commented Sep 19, 2023

After looking into this, it seems as though this may be an issue with the security app's router rather than dashboard's. Basically, when I was looking into this on my own, I found that the navigateToApp function in core was getting called with the expected path - i.e. app/dashboards#/view/<id>. However, on navigation, something was happening where, despite starting at the correct/expected URL, I would then get redirected to app/dashboards?, which ultimately redirected me to the dashboard listing page.

I called in @ThomThomson for reinforcements, and we found that at the point of navigation, the dashboard app's hash was already incorrect, which is not the case in any other solution (we tested observability, Discover, management, and a few others - the dashboard router's hash was correct in all cases and navigation worked as expected). This suggests that there is some sort of conflict happening between security's router and dashboard's, which is causing this weird behaviour. I've tried to show this in the following video:

Screen.Recording.2023-09-19.at.11.38.24.AM.mov

Note that both "Recent" and links panels are experiencing the exact same bug, so I've demonstrated it with the links panel in the above video but the same applies to navigating through recent.

@Heenawter Heenawter added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Sep 19, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@Heenawter Heenawter added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Sep 19, 2023
@Heenawter
Copy link
Contributor

Heenawter commented Sep 19, 2023

Assigning impact:high because of the impact on the links panel - since we plan to release the links panel in v8.11, and since Security allows users to edit/create their own dashboards to show up in their portable dashboard implementation, it will be possible for users to end up with links panels in their Security dashboards which won't work at all - these links will always redirect to the listing page.

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@angorayc
Copy link
Contributor

angorayc commented Sep 20, 2023

It's the same bug that causes this issue and #166774

Basically it's x-pack/plugins/security_solution/public/flyout/shared/hooks/url/use_sync_flyout_state_with_url.tsx line 25 syncStateToUrl
packages/kbn-url-state/use_sync_to_url.ts line 61, the new url does not include window.location.hash

I'll do a quick fix in #159486 to put the hash back.
const newUrl = ${window.location.pathname}${window.location.hash}?${newSearch};

I'll also ask the team about better way of implementing syncStateToUrl

@ThomThomson
Copy link
Contributor

@angorayc thank you for looking into this and finding the root cause!

@angorayc
Copy link
Contributor

@angorayc thank you for looking into this and finding the root cause!

@dej611 Found it. Thank you @dej611 , Security Solution team appreciate you!

@ThomThomson ThomThomson removed the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas label Sep 20, 2023
lgestc added a commit that referenced this issue Sep 22, 2023
## Summary

This PR fixes the root cause for
#166686 and
#166774

@angorayc @machadoum 


### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Sep 22, 2023
## Summary

This PR fixes the root cause for
elastic#166686 and
elastic#166774

@angorayc @machadoum

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit d52c5a1)
kibanamachine added a commit that referenced this issue Sep 29, 2023
…167010)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[Security Solution] Fix missing hash in sync to url
(#166847)](#166847)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Luke
G","email":"11671118+lgestc@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-09-22T08:23:50Z","message":"[Security
Solution] Fix missing hash in sync to url (#166847)\n\n##
Summary\r\n\r\nThis PR fixes the root cause
for\r\nhttps://github.com//issues/166686
and\r\nhttps://github.com//issues/166774\r\n\r\n@angorayc
@machadoum \r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are
not applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"d52c5a15fdd9e3c8502fbb75378295c5c7649cc6","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Threat
Hunting:Investigations","v8.11.0","v8.10.2"],"number":166847,"url":"#166847
Solution] Fix missing hash in sync to url (#166847)\n\n##
Summary\r\n\r\nThis PR fixes the root cause
for\r\nhttps://github.com//issues/166686
and\r\nhttps://github.com//issues/166774\r\n\r\n@angorayc
@machadoum \r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are
not applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"d52c5a15fdd9e3c8502fbb75378295c5c7649cc6"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"#166847
Solution] Fix missing hash in sync to url (#166847)\n\n##
Summary\r\n\r\nThis PR fixes the root cause
for\r\nhttps://github.com//issues/166686
and\r\nhttps://github.com//issues/166774\r\n\r\n@angorayc
@machadoum \r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are
not applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"d52c5a15fdd9e3c8502fbb75378295c5c7649cc6"}},{"branch":"8.10","label":"v8.10.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Luke G <11671118+lgestc@users.noreply.github.com>
@MadameSheema
Copy link
Member

Issue fixed on 8.11-BC1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Dashboard Dashboard related features fixed impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team v8.11.0
Projects
No open projects
Dashboard
  
Inbox
Development

No branches or pull requests

10 participants