mikebridge commented on PR #44184: URL: https://github.com/apache/superset/pull/44184#issuecomment-5684842969
You're right, and it's distinct from the live-holder fix — that guard only ever looks at the requested slug, so with archived slug S and a live dashboard holding uuid U under a different slug, there's no live S holder to find and the uuid failure still comes back as restore-the-archived-dashboard guidance. Since the create schema accepts a client-supplied uuid, it's reachable. Fixed in 96a620a6b5: the translator now requires positive identification that the caught error is a dashboard *slug* uniqueness violation before it translates — PostgreSQL by SQLSTATE 23505 plus `diag.constraint_name`, MySQL by errno 1062 plus the quoted key name (table-qualified or not), SQLite by its exact `UNIQUE constraint failed: dashboards.slug` diagnostic, matching both `idx_unique_slug` and the partial `ix_dashboards_active_slug`. Anything missing, ambiguous, or from another constraint returns untranslated so the caller re-raises the original error, and the live-holder guard still runs after the gate. The diagnostic is read from `ex.orig` rather than the SQLAlchemy wrapper's `str()`, which embeds the statement and bound parameters — a dashboard whose slug text contained a constraint name would otherwise fool it — and there's a regression pinning that. Added your archived-S/duplicate-U case as an integration test asserting no restore guidance in the response, plus unit coverage for identified uuid constraints, unidentifiable failures, and the positive slug diagnostics on each dialect. -- 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]
