dosubot[bot] commented on issue #40704: URL: https://github.com/apache/superset/issues/40704#issuecomment-4619123635
<!-- Answer --> That's a great observation, and your intuition about `HYDRATE_DASHBOARD` is likely correct. Here's what I found about why tabs specifically trigger this: **The core difference between tabbed and non-tabbed dashboards during hydration:** - **Without tabs**: All charts render immediately after hydration and execute their queries with the restored `dataMask` (filter state) applied — so everything works. - **With tabs**: Only charts on the *active* tab render and execute queries. Charts on inactive tabs have their `dataMask` initialized in Redux but don't actually render or execute queries until their tab is activated [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx#L452-L468). The `Chart` component uses a memo optimization that [skips re-renders when `isComponentVisible` is false](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx#L540-L559). **The likely problem on return navigation:** When you return to the dashboard, `HYDRATE_DASHBOARD` fires and re-initializes `dataMask` using a [priority chain](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dataMask/reducer.ts#L72-L76): initial empty state → filter defaults → persisted dataMask. The `activeTabs` value is resolved as `activeTabs || dashboardState?.activeTabs || []` [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/actions/hydrate.js#L309). The [`useIsFilterInScope()` hook](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/state.ts#L100-L132) gates filter application based on whether a filter's containing tab is in `activeTabs`. If `activeTabs` is empty or stale during rehydration, the scope check (`tabParents.every(tab => activeTabs.includes(tab))`) could fail, causing filters to appear selected in the UI but not propagate to chart queries. So the issue is likely a timing/ordering problem: the `dataMask` is restored correctly (filters show as selected), but the active tab state isn't fully resolved when charts on the current tab try to determine which filters are "in scope" — resulting in charts rendering without applied filters. A potential area to investigate would be ensuring `activeTabs` is properly set *before* charts evaluate filter scope during rehydration, or ensuring charts on the active tab re-query after both `dataMask` and `activeTabs` are settled. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=981b3c27-61d2-4adb-921a-f8212c4a8ce6) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
