codeant-ai-for-open-source[bot] commented on code in PR #43223:
URL: https://github.com/apache/superset/pull/43223#discussion_r3789528253
##########
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts:
##########
@@ -148,7 +170,7 @@ export function useFilterOperations({
return (
component &&
'filterType' in component &&
- ALLOW_DEPENDENCIES.includes(component.filterType)
+ filterSupportsDependencies(component.filterType)
Review Comment:
**Suggestion:** Changing a filter to a type whose metadata sets
`supportsCascadeDependencies` to `false` only prevents it from appearing in
newly computed available-parent options; existing child dependencies are still
retained by the form and consumed by `buildDependencyMap` and the dependency
preview until the modal is saved. This leaves an unsupported parent actively
affecting other filters while the modal remains open, and cancelling the modal
can preserve the stale in-memory relationship. Remove or filter existing
dependency edges as soon as the parent capability changes, rather than only
relying on save-time cleanup. [stale reference]
<details>
<summary><b>Severity Level:</b> Minor ๐งน</summary>
```mdx
- โ ๏ธ Filter previews can temporarily use unsupported cascade parents.
- โ ๏ธ Unmounted child forms retain stale dependency IDs until save.
- โ ๏ธ Save-time cleanup prevents persisted invalid relationships.
- โ ๏ธ Cancel resets form state, so cancellation does not preserve them.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=271801fc21e34755abf1368562f9cc6b&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=271801fc21e34755abf1368562f9cc6b&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/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts
**Line:** 173:173
**Comment:**
*Stale Reference: Changing a filter to a type whose metadata sets
`supportsCascadeDependencies` to `false` only prevents it from appearing in
newly computed available-parent options; existing child dependencies are still
retained by the form and consumed by `buildDependencyMap` and the dependency
preview until the modal is saved. This leaves an unsupported parent actively
affecting other filters while the modal remains open, and cancelling the modal
can preserve the stale in-memory relationship. Remove or filter existing
dependency edges as soon as the parent capability changes, rather than only
relying on save-time cleanup.
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%2F43223&comment_hash=1587f01332aa2a535fa213ec60c799826d8685b99256a42b8e6e8cb2e8ab9211&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43223&comment_hash=1587f01332aa2a535fa213ec60c799826d8685b99256a42b8e6e8cb2e8ab9211&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]