Bug description

If we use filters between auto-refresh, switching tabs does not include the 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, the changed year does not change the year for other tabs, making data look like for another year than it is).

It is crucial that all tabs in question are already loaded (not the first activation).

it is basic functionality of Superset, not some sort of hard-to-stumble-upon edge case.

If anyone will create reports with multiple tabs, and will read out through all of these then change filters, it is bound to happen sooner or later that if auto-refresh is enabled, then it will kick in before one will read all tabs again with a new filter solution.

To reproduce:

Create a dataset with two values, like year 2024/2025 Create a chart that just shows the value from this dataset Create a copy of the new chart Create a dashboard with 2 tabs and add the above charts to it, one for each tab Add a filter to the dashboard that filters this new dataset, making it single-choice, first default, and ordered by value.

Open dashboard Wait for tab A to load Move to tab B and wait for it to load Move to tab A Turn on auto-refresh with a tick of 30 seconds Wait for auto-refresh After info about auto-refresh fades, change the value in the filter bar Wait for another auto-refresh Move tab to B ERROR: Filter shows changed value (same as for tab B) for the chart, but it shows data for the filtering scenario that this tab was loaded initially with

Seeing is believing, so here is an example:

https://github.com/user-attachments/assets/ba39f416-6251-4d25-aca0-4cb8c9401185

Screenshots/recordings

No response

Superset version

4.1.3, 3.1.0

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • [x] 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: msyavuz

I can't reproduce this in 5.0, my guess is that this is either a state desync or some kind of race condition

Comment From: rusackas

Yeah, I feel like we've been tackling this sort of thing forever. I/we will try throwing Claude at this thing to see if we can get some tests/suggestions/solutions going here.

Comment From: tomaszmalec

Image

I've tested it with newest version from repo - 4.1.3 - and the problem is the same.

Comment From: tomaszmalec

I can only guess that Superset has a single global flag indicating that filters changed, and auto-refresh resets it each tick, making all tabs that are already loaded miss the trigger to refresh, as auto-refresh does not refresh all at the same time, as that would make a huge performance impact. If there were a table of flags for each tab, it would be possible for auto-refresh to clear out only the tab that was actually refreshed, and make tabs "in waiting" to refresh on the spot when we move to them.

Comment From: rusackas

I've tested it with newest version from repo - 4.1.3

5.0.0 is the newest, if you want to test there... or on master from which we just recently cut our 6.0.0 release (now available for testing, too).

Comment From: tomaszmalec

I did use "git clone --depth=1 https://github.com/apache/superset.git" and that's what I landed with. I will try to get a specific version later on and try it out

Comment From: tomaszmalec

The issue can not be replicated on Superset 5.0.0, so there must be a difference between 5 and prior versions in the processing of filters - on 5.0.0, there is a clear reload every time the tab is changed no matter if there was an auto-reload between filter change and tab change.