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
- [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [X] 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]
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.
Comment From: tomaszmalec
@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
Comment From: dosubot[bot]
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.
Comment From: tomaszmalec
Comment From: rusackas
Are you still facing this issue? It might be that this is just a weird edge case, or like me, people are finding it a little hard to understand with these repro steps. If you can record a video explaning what you're seeing, and it's in the latest supported release (4.1.2 or newer), that'd help.
Comment From: rusackas
Closing as inactive / not planned, but happy to revisit!