fix(frontend): tighten SQL Lab autorun scoping and HTML-rendering defaults (#43398)

Co-authored-by: Superset Dev <dev@superset.apache.org>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2026-08-21 12:31:08 -07:00
committed by GitHub
co-authored by Superset Dev Claude Sonnet 5
parent 03eac279e5
commit edda9d1bbb
18 changed files with 366 additions and 26 deletions
@@ -1524,7 +1524,9 @@ export function popPermalink(key: string): SqlLabThunkAction<Promise<unknown>> {
dbId: json.dbId ? parseInt(json.dbId, 10) : undefined,
catalog: json.catalog ?? null,
schema: json.schema ?? undefined,
autorun: json.autorun ? json.autorun : false,
// The recipient must review the prefilled query and press
// Run; a permalink payload never auto-runs.
autorun: false,
sql: json.sql ? json.sql : 'SELECT ...',
templateParams: json.templateParams,
}),
@@ -1548,7 +1550,9 @@ export function popStoredQuery(
dbId: json.dbId ? parseInt(json.dbId, 10) : undefined,
catalog: json.catalog ?? null,
schema: json.schema ?? undefined,
autorun: json.autorun ? json.autorun : false,
// Same rule as popPermalink above — stored payloads never
// auto-run.
autorun: false,
sql: json.sql ? json.sql : 'SELECT ...',
templateParams: json.templateParams,
}),
@@ -1627,7 +1631,9 @@ export function popDatasourceQuery(
name: `${QUERY_TEXT} ${json.result.name}`,
dbId: json.result.database.id,
schema: json.result.schema,
autorun: sql !== undefined,
// `sql` here can come straight from the URL, so its mere
// presence must never imply auto-execution.
autorun: false,
sql: sql || json.result.select_star,
}),
),