kokhlo commented on issue #44304: URL: https://github.com/apache/superset/issues/44304#issuecomment-5679764377
Correction after digging into current main — the reported 6.1.0 chain (IntegrityError → generic message) no longer reproduces there, but the ticket is still live with a shifted symptom: - #42582 (merged 5 days ago) added slug-resolution to `import_dashboard()`: a fresh-UUID config whose slug matches an *active* dashboard is resolved onto that row and `config["uuid"]` aligned to it, with the permission gate applied. The DB constraint therefore never fires. - But `ImportModelsCommand._prevent_overwrite_existing_model()` is still UUID-only. So on main today, without `overwrite` the import **silently merges the bundle's charts into the slug-owning dashboard** (no error, no OVERWRITE prompt — the exact modal flow this issue asks for never appears), and with `overwrite` it updates that dashboard even though the user confirmed overwriting a *different* UUID they never saw. - `slug` is one of `Dashboard`'s import identity keys (`test_dashboard_unique_constraints_includes_slug`), so the overwrite gate should treat a slug collision as an existing-resource conflict, same as a UUID match. Revised plan: in `ImportDashboardsCommand`, extend `_prevent_overwrite_existing_model()` to also flag a config whose non-empty slug is owned by a different active dashboard, reusing the exact `already exists and `overwrite=true` was not passed` wording the UUID check emits (naming the slug) — that is the string `isAlreadyExists()` in the ImportModal matches on, so the existing OVERWRITE confirmation starts appearing for this case, and the confirmed path then goes through the already-correct slug-resolution + permission gates in `import_dashboard()`. Same-UUID hits keep coming from the base check; slug `None`/empty configs and soft-deleted owners stay out of scope. Regression tests for both branches. -- 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]
