`chartsInScope` references are not fixed during a Dashboard import
When a dashboard is imported using the ImportDashboardsCommand (v1), the charts id references are replaced from withing the position_metadata and json_metadata with the ids of the newly created charts in the target instance.
During that process, it looks like some IDs have been missed in the native filters configuration. Indeed, the chartsInScope references are never replaced with the newly created charts ids.
How to reproduce the bug
- Create a dummy dashboard, with a dummy chart
- Export the dashboard
- Update the ZIP file chart file, by replacing the
uuidof the chart with a new randomuuid - Update the ZIP file dashboard file, by replacing the
uuidof the chart with a new randomuuid, and by replacing theposition.CHART.meta.uuidentry with the chart newuuidgenerated in step 3 above - Re-import the dashboard
- Look at the newly create dashboard payload. The
json_metadatanative filterschartsInScopeis still made of the former chart ID
Expected results
The imported dashboard json_metadata payload chartsInScope should be made of charts ID which compose this dashboard, in order the filtersInScope and filtersOutScope to be accuratelly computed.
Actual results
The imported dashboard json_metadata payload chartsInScope is made of old charts ID which don't compose this new dashboard. It results in the filtersInScope and filtersOutScope to not be correct after import.
Screenshots
Environment
(please complete the following information):
- browser type and version: Chrome
- superset version: 2.0.1 and 3.0.2
- python version: 3.9
- node.js version: N/A
- any feature flags active: N/A
Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [x] I have reproduced the issue with at least the latest released version of superset.
- [x] I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
Add any other context about the problem here.