codeant-ai-for-open-source[bot] commented on code in PR #43108:
URL: https://github.com/apache/superset/pull/43108#discussion_r3773907579
##########
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:
**Suggestion:** The storage key contains only the dashboard ID, so logging
out and signing in as another user in the same browser profile reuses the
previous user's filter selections. This can expose private filter values and
apply user-specific state to another user's session; include an authenticated
user or instance-specific scope in the key, or clear these entries on logout.
[security]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ Shared-browser users can see another user's filter selections.
- ⚠️ User-specific filters can affect another user's dashboard queries.
- ⚠️ Logout cleanup omits the new dashboard storage namespace.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d7dca4fabe61445a9565c00660e22a4b&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=d7dca4fabe61445a9565c00660e22a4b&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/containers/DashboardPage.tsx
**Line:** 84:84
**Comment:**
*Security: The storage key contains only the dashboard ID, so logging
out and signing in as another user in the same browser profile reuses the
previous user's filter selections. This can expose private filter values and
apply user-specific state to another user's session; include an authenticated
user or instance-specific scope in the key, or clear these entries on logout.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43108&comment_hash=0b277ac9eed2478d8e06d22457e3c3aacfefbf1a10df22602c5e23d884083183&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43108&comment_hash=0b277ac9eed2478d8e06d22457e3c3aacfefbf1a10df22602c5e23d884083183&reaction=dislike'>👎</a>
##########
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:
**Suggestion:** The effect persists the entire Redux data mask rather than
only native filter entries. That mask includes chart customization and other
interaction entries, and dashboard hydration explicitly reads persisted entries
for configured chart customizations, so revisiting a dashboard can restore
stale chart customization state even though this feature is intended to persist
filter selections. Persist only native filter IDs (and exclude synthetic or
transient entries) before saving. [state/lifecycle]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Chart customizations can remain stale across dashboard visits.
- ❌ Reopened dashboards may use unintended query controls.
- ⚠️ Synthetic URL-filter entries can outlive their originating URL.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=9e108d2066e64e08bfc95ee08979a630&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=9e108d2066e64e08bfc95ee08979a630&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/containers/DashboardPage.tsx
**Line:** 418:418
**Comment:**
*State Lifecycle: The effect persists the entire Redux data mask rather
than only native filter entries. That mask includes chart customization and
other interaction entries, and dashboard hydration explicitly reads persisted
entries for configured chart customizations, so revisiting a dashboard can
restore stale chart customization state even though this feature is intended to
persist filter selections. Persist only native filter IDs (and exclude
synthetic or transient entries) before saving.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43108&comment_hash=517e02a47d9375dec8f6f26cffa9474b83d8bb806fb2b9c53bb9a9f9f31dbcc4&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43108&comment_hash=517e02a47d9375dec8f6f26cffa9474b83d8bb806fb2b9c53bb9a9f9f31dbcc4&reaction=dislike'>👎</a>
--
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]