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

bug: Filters are not updating with force update if cache is enabled for some time #25893

Closed
pankajsoni22 opened this issue Nov 7, 2023 · 5 comments · Fixed by #29291
Closed

Comments

@pankajsoni22
Copy link
Contributor

When the dashboard has a filter and responses are cached for let say 24 hours, even after force refreshing the entire dashboard, list of values in the filter do not update (considering there are new values in filter)

How to reproduce the bug

  1. Go to dashboard that has dropdown filter
  2. Force refresh the entire dashboard
  3. If you expect new value in the filter, it will not be there.

Expected results

Updated filter value should be there.

Actual results

Updated list of values.

Environment

Caching the data for 24 hours. Using superset 3.0.1

@rusackas
Copy link
Member

rusackas commented Apr 5, 2024

@michael-s-molina @kgabryje do either of you happen to know if the cache of the native filters is tied to the linked of the dashboard? Or if there's another way to clear/refresh the cache for the native filters?

@michael-s-molina
Copy link
Member

@rusackas Using master, I can see that the query to retrieve the filters values is being fired but is not using the force=true parameter and will return cached values.

Screen.Recording.2024-04-05.at.14.38.09.mov

@jwdalton
Copy link

jwdalton commented Jun 12, 2024

This patch seems to have fixed it for me. Now when I click "Refresh Dashboard", the refresh calls for the filters also have force=true set.

diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx
index 5041fa3c97..2e626636c7 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx
@@ -174,7 +174,7 @@ const FilterValue: React.FC<FilterControlProps> = ({
       setIsRefreshing(true);
       getChartDataRequest({
         formData: newFormData,
-        force: false,
+        force: shouldRefresh,
         ownState: filterOwnState,
       })
         .then(({ response, json }) => {

@ka-weihe
Copy link
Contributor

#21234

@ka-weihe
Copy link
Contributor

I have opened a PR for fixing this:
#29291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants