msyavuz opened a new pull request, #42032: URL: https://github.com/apache/superset/pull/42032
### SUMMARY Native filters and chart customizations (e.g. a "Time Column" display control) share the single `nativeFilters.filters` Redux map, but `handleFilterChangesComplete` rebuilt that map from scratch using only the current save's payload. Saving/applying a display control sends a customization-only payload, so **every native filter was wiped from the map**. The filter still rendered (it's driven by dashboard metadata), so the next interaction with a native Time Range filter reached the focus-highlight hook → `getRelatedCharts`, which read `.scope` on the now-`undefined` filter and crashed the whole dashboard with `Cannot read properties of undefined (reading 'scope')`. Fix, two layers: - **Root cause:** merge the incoming payload into the existing map instead of replacing it, and apply deletions explicitly via a new `deletedIds` field. Both save paths (`saveChartCustomization`, `setFilterConfiguration`) pass their deleted IDs. This also fixes the symmetric case where saving native filters dropped customizations. - **Defense in depth:** `getRelatedCharts` returns `[]` on an undefined filter so a transient missing entry can never white-screen the dashboard. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Before: dashboard crashes to the "Unexpected error" boundary when a Time Range filter is used right after applying a Time Column display control. After: both coexist and update normally, no exception. ### TESTING INSTRUCTIONS 1. Open a dashboard, **+ New → Add display control**, type = Time column, pick a dataset, Save. 2. Add a native **Time Range** filter to the same dashboard. 3. Select a value in the Time Column control and Apply. 4. Interact with the Time Range filter → dashboard updates instead of crashing. Unit tests: `nativeFilters.test.ts` (merge + explicit-delete + native-filter-preservation regression) and `getRelatedCharts.test.ts` (undefined-filter guard). ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [x] Changes UI — fixes a dashboard crash; no visual changes - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
