omsn2 commented on code in PR #43108:
URL: https://github.com/apache/superset/pull/43108#discussion_r3776361513


##########
superset-frontend/src/dashboard/containers/DashboardPage.tsx:
##########
@@ -381,8 +410,14 @@ export const DashboardPage: FC<PageProps> = ({ idOrSlug }: 
PageProps) => {
   }, [addDangerToast, datasets, datasetsApiError, dispatch, isNotFoundError]);
 
   const relevantDataMask = useSelector(selectRelevantDatamask);
+  const fullDataMask = useSelector(selectDataMask);
   const activeFilters = useSelector(selectActiveFilters);
 
+  useEffect(() => {
+    if (!id || hydratedDashboardId !== id) return;
+    saveDashboardFilters(id, fullDataMask);

Review Comment:
   Fixed in the latest commit. The save effect now filters the Redux dataMask 
against the set of configured native filter IDs from 
state.nativeFilters.filters before persisting. Only entries whose keys match a 
configured native filter are saved to localStorage. This prevents chart 
customization state, cross-filter interaction entries, and other transient 
dataMask entries from being incorrectly serialized and later restored as if 
they were user-applied filter selections.



##########
superset-frontend/src/dashboard/containers/DashboardPage.tsx:
##########
@@ -81,6 +81,30 @@ import {
 
 type NativeFilterConfigEntry = Partial<Filter> & { id: string };
 
+const DASHBOARD_FILTERS_STORAGE_PREFIX = 'superset_dashboard_filters_';

Review Comment:
   Fixed in the latest commit. The storage key is now scoped to the 
authenticated user ID using the format 
superset_dashboard_filters_<userId>_<dashboardId>. This ensures that logging 
out and signing in as a different user in the same browser profile will not 
expose or reuse the previous user's filter state. Guest users (who have no 
userId) gracefully fall back to the dashboard-only key, since guest sessions 
are inherently ephemeral and not tied to a persistent account.



-- 
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]

Reply via email to