opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.68k stars 884 forks source link

[BUG] "Add to Dashboards after saving" not working when creating a visualization #7204

Open dmoreira-sbp opened 3 months ago

dmoreira-sbp commented 3 months ago

Describe the bug

In one of our OpenSearch environments, the "Add to Dashboards after saving" option doesn't seem to be working correctly.

To Reproduce Steps to reproduce the behavior:

  1. Go to a dashboard
  2. Click on 'Edit', 'Create new', select any type of visualization and then select the source
  3. Click 'Save', enter a title and keep the 'Add to Dashboards after saving' selected.
  4. It should return to the dashboard but it doesn't add it right away.

It does work if you add it after the fact.

Expected behavior A clear and concise description of what you expected to happen.

OpenSearch Version 2.13.0 (AWS-Managed)

Dashboards Version 2.13.0 (Not-AWS managed. Running "opensearchproject/opensearch-dashboards:2.13.0" on AWS ECS

What I did notice is that in the GET request in which it tries to fetch the visualization id by name, it returns an empty list (adding screenshots)

Screenshots EDIT: I've just noticed that the request that you see in the screenshots might be the one that the dashboard does to check if there's already another visualization with the same name, so it might not apply

Screenshot 2024-07-09 120800

Screenshot 2024-07-09 120831 -f3d5ba04f224) Screenshot 2024-07-09 120845

dmoreira-sbp commented 1 month ago

Hi! After researching a bit more with a local environment, I see that in the "_find" call in my local environment it gets several related objects in the results, but it doesn't happen in the production environment image image

neodescis commented 1 month ago

Do any of you by chance have storeInSessionStorage turned on? I can reliably reproduce this only when it's on. It seems that with it enabled, the state data stored in location history, which is needed to add the visualization to the dashboard, doesn't survive the transition back to the dashboard page.