Bug description

To reproduce the error - it is necessary 1)Create a dashboard - save it 2)Delete the newly created dashboard 3) go to any other dashboard and get the error 'There was an issue fetching the favorite status of this dashboard'.

I also noticed that if the dashboard is not deleted, then every time you go to the dashboard, requests will be executed. api/v1/dashboard/favorite_status/ and superset/log/?explode=event of the previous dashboard.

Screenshots/recordings

Created Dashboard with id = 258 Image

When loading a dashboard with id = 55 - you can see that some methods work with the old dashboard id 258. Image

Superset version

4.1.1

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

The issue you're encountering seems to be related to caching or stale data being retained after a dashboard is deleted. When a dashboard is deleted, any cached data or network requests associated with it should be invalidated to prevent errors like the one you're experiencing.

Superset uses caching mechanisms for dashboard data, and if a dashboard is deleted, the cached data might still exist until it expires or is explicitly cleared. This can lead to inconsistencies, such as the error you're seeing when trying to fetch the favorite status of a deleted dashboard [1].

To address this, you can use the cache invalidation process provided by Superset. The invalidate method in the CacheRestApi class can be used to invalidate cache entries related to specific datasources. This method is exposed via a POST request to the /invalidate endpoint, which processes the request to invalidate cache entries [2].

Additionally, ensure that the handleDashboardDelete function is correctly implemented to refresh the data and update the UI after a dashboard is deleted. This function makes a DELETE request to remove the dashboard and refreshes the data to reflect the updated state [3].

By ensuring that cache entries are invalidated and the UI is refreshed after a dashboard deletion, you should be able to resolve the error you're encountering.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

Comment From: SBIN2010

Image when I go to the dashboard I can see that some methods of the previous dashboard are loaded.

Comment From: rusackas

This is annoying, but doesn't really break workflows (thankfully). We're open to PRs if anyone's interested. Maybe it's just being cached/memoized somewhere in the frontend?

Comment From: maishivamhoo123

@rusackas sir i want to work on this issue. could you please assign it to me?

Comment From: rusackas

Sorry for the delay here @maishivamhoo123 - we don't really use Assignment very formally on this repo, but I've assigned it to you, and you (or anyone) are more than welcome to tackle this!