opensearch-project / OpenSearch-Dashboards

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

[BUG] Index pattern service returns inconsistent title #7837

Open ashwin-pc opened 1 month ago

ashwin-pc commented 1 month ago

Describe the bug

The index pattern service updated the cached index pattern title to contain the datasource title in it, but this behaviour is not consistent and calling the get method on the index pattern service shows only the saved object title without the datasource in title. This leads to inconsistent behaviour in the UI.

https://github.com/opensearch-project/OpenSearch-Dashboards/blob/2.16/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts#L124-L135

To Reproduce Steps to reproduce the behavior:

  1. Call indexPatterns.getIdsWithTitle()
  2. Call indexPatterns.get(id) // any id from the previous list
  3. Compare the titles

Expected behavior Instead of modifying the cache, we shoud store the datasource title as well if we want to avoid another call for the datasource and only append it where we display it to the user. We should ideally never modify the raw title attribute since without it we no longer know what the index pattern title was without making a raw call to the saved object service.

OpenSearch Version 2.16

Dashboards Version 2.16

Plugins

Please list all plugins currently enabled.

Screenshots

If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

Additional context

Add any other context about the problem here.

dblock commented 2 weeks ago

[Catch All Triage - 1, 2, 3, 4, 5]