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

Auto-refresh broken filtering on multiple tabs #30698

Open
2 of 3 tasks
tomaszmalec opened this issue Oct 24, 2024 · 4 comments
Open
2 of 3 tasks

Auto-refresh broken filtering on multiple tabs #30698

tomaszmalec opened this issue Oct 24, 2024 · 4 comments
Labels
dashboard:native-filters Related to the native filters of the Dashboard dashboard:refresh Related to the refresh frequency of the Dashboard

Comments

@tomaszmalec
Copy link

Bug description

If we use filters between auto-refresh, switching tabs do not include changed filters, what's more, filters show change, but the tab does not, making it look like legit information when it is not (for example changed year does not change year for other tabs, making data look like for another year than it is).

To reproduce:

  • Dashboard with at least 2 tabs and filter year in the side-bar
  • Load tab A
  • Load tab B
  • Turn on auto-refresh for 1 min
  • Wait for auto-refresh
  • Change the year in the filter bar before the new auto-refresh kicks in
  • Wait for auto-refresh
  • Change tab to A
  • ERROR: Filter shows changed value (same as for tab B), but charts show data for filtering scenario that tab was loaded initially with

Screenshots/recordings

No response

Superset version

4.0.2

Python version

Not applicable

Node version

Not applicable

Browser

Chrome

Additional context

The test was done using both 3.1.0 and 4.0.2 images pulled with docker from the official repo.

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.
Copy link

dosubot bot commented Oct 24, 2024

Hey @tomaszmalec! I'm here to help you with any bugs, questions, or contributions you have for the project. Let's work together to resolve this issue!

To address the issue where auto-refresh does not update filters correctly across multiple tabs in Superset version 4.0.2, you should look into the fix provided in pull request #29291. This fix addresses the problem of filters not updating with force update when caching is enabled. Ensure that your Superset instance includes this fix, as it may resolve the inconsistency with the selected filters during auto-refresh [1].

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added dashboard:native-filters Related to the native filters of the Dashboard dashboard:refresh Related to the refresh frequency of the Dashboard labels Oct 24, 2024
@tomaszmalec
Copy link
Author

@dosu reported issue is not related to the filter bar, it is related to charts.
Cache in this scenario is disabled (-1) so that is even more not related to the issue that was triggered as similar

Copy link

dosubot bot commented Oct 24, 2024

The issue you're experiencing seems to be related to how Superset handles state management for filters and charts across multiple tabs. When switching tabs, filters should apply only to charts that are visible within the active tabs. However, it appears that the auto-refresh mechanism might not be correctly updating the charts with the new filter values when switching tabs.

Superset uses functions like useIsFilterInScope and useSelectFiltersInScope to determine which filters are in scope based on the active tabs and the dashboard layout. These functions ensure that filters are applied only to charts that are visible within the active tabs [1][2].

Given that caching is disabled, the issue might be related to how the auto-refresh mechanism interacts with these functions. It could be beneficial to review the implementation of these functions and the auto-refresh logic to ensure they are correctly handling the state updates across tabs.

To continue talking to Dosu, mention @dosu.

@tomaszmalec
Copy link
Author

tomaszmalec commented Oct 24, 2024

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard:native-filters Related to the native filters of the Dashboard dashboard:refresh Related to the refresh frequency of the Dashboard
Projects
None yet
Development

No branches or pull requests

1 participant