Skip to content

fix: Fix SupersetClient.postForm calls when SUPERSET_APP_ROOT defined - #38069

Closed
martyngigg wants to merge 4 commits into
apache:masterfrom
ISISNeutronMuon:improve-supersetclient-postform-api
Closed

martyngigg wants to merge 4 commits into
apache:masterfrom
ISISNeutronMuon:improve-supersetclient-postform-api

Conversation

@martyngigg

Copy link
Copy Markdown
Contributor

SUMMARY

The SupersetClient.postForm API only accepted an endpoint and when called with a url caused a doubling up of the app_root when it was defined. We have changed the postForm signature to accept either a url or endpoint that is passed to getUrl. Call sites and tests have been updated.

This PR required brings in changes from:

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

Set SUPERSET_APP_ROOT=/analytics in docker/.env-local and boot up the docker-compose-light setup.

  • Test login works and does not give a 404
  • Test exporting a chart works and the url does not contain the app_root twice.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

* Include app_root in login next= parameter

* Fix login with OAUTH/LDAP when app_root is defined

* Add tests for Login links on Register/Login pages
@dosubot dosubot Bot added the change:frontend Requires changing the frontend label Feb 18, 2026
Comment on lines +123 to +126
hiddenForm.action = this.getUrl({
endpoint: postFormConfig.endpoint,
url: postFormConfig.url,
});

Check failure

Code scanning / CodeQL

DOM text reinterpreted as HTML High

DOM text
is reinterpreted as HTML without escaping meta-characters.
@bito-code-review

Copy link
Copy Markdown
Contributor

The security alert flags a potential XSS vulnerability in the postForm method of SupersetClientClass.ts, where payload values are assigned to form input values without escaping HTML meta-characters. If these values are displayed as HTML on the target page after form submission, it could allow script injection. The diff shows changes to how the payload is handled, but the full method isn't visible. Sanitize or escape payload values before setting them to prevent reinterpreting text as HTML.

@netlify

netlify Bot commented Feb 18, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 8970767
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6995c1cd609d1b0008e9671e
😎 Deploy Preview https://deploy-preview-38069--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Feb 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.43%. Comparing base (9131739) to head (abf5c08).
⚠️ Report is 4104 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #38069       +/-   ##
===========================================
+ Coverage        0   66.43%   +66.43%     
===========================================
  Files           0      668      +668     
  Lines           0    51376    +51376     
  Branches        0     5791     +5791     
===========================================
+ Hits            0    34132    +34132     
- Misses          0    15855    +15855     
- Partials        0     1389     +1389     
Flag Coverage Δ
hive 41.44% <50.00%> (?)
mysql 64.54% <100.00%> (?)
postgres 64.61% <100.00%> (?)
presto 41.46% <50.00%> (?)
python 66.40% <100.00%> (?)
sqlite 64.21% <100.00%> (?)
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #539b61

Actionable Suggestions - 1
  • superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts - 1
Review Details
  • Files reviewed - 16 · Commit Range: 8970767..8970767
    • superset-frontend/packages/superset-ui-core/src/connection/SupersetClient.ts
    • superset-frontend/packages/superset-ui-core/src/connection/SupersetClientClass.ts
    • superset-frontend/packages/superset-ui-core/src/connection/types.ts
    • superset-frontend/packages/superset-ui-core/test/connection/SupersetClient.test.ts
    • superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts
    • superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx
    • superset-frontend/src/components/Chart/chartAction.ts
    • superset-frontend/src/explore/components/controls/DatasourceControl/index.tsx
    • superset-frontend/src/explore/components/controls/ViewQueryModalFooter.tsx
    • superset-frontend/src/explore/exploreUtils/index.ts
    • superset-frontend/src/pages/Login/Login.test.tsx
    • superset-frontend/src/pages/Login/index.tsx
    • superset-frontend/src/pages/Register/Register.test.tsx
    • superset-frontend/src/pages/Register/index.tsx
    • superset/views/utils.py
    • tests/integration_tests/test_subdirectory_deployments.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #b02e7d

Actionable Suggestions - 0
Review Details
  • Files reviewed - 16 · Commit Range: 8970767..c58fa53
    • superset-frontend/packages/superset-ui-core/src/connection/SupersetClient.ts
    • superset-frontend/packages/superset-ui-core/src/connection/SupersetClientClass.ts
    • superset-frontend/packages/superset-ui-core/src/connection/types.ts
    • superset-frontend/packages/superset-ui-core/test/connection/SupersetClient.test.ts
    • superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts
    • superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx
    • superset-frontend/src/components/Chart/chartAction.ts
    • superset-frontend/src/explore/components/controls/DatasourceControl/index.tsx
    • superset-frontend/src/explore/components/controls/ViewQueryModalFooter.tsx
    • superset-frontend/src/explore/exploreUtils/index.ts
    • superset-frontend/src/pages/Login/Login.test.tsx
    • superset-frontend/src/pages/Login/index.tsx
    • superset-frontend/src/pages/Register/Register.test.tsx
    • superset-frontend/src/pages/Register/index.tsx
    • superset/views/utils.py
    • tests/integration_tests/test_subdirectory_deployments.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #24b841

Actionable Suggestions - 0
Review Details
  • Files reviewed - 17 · Commit Range: c58fa53..cc8f486
    • superset-frontend/packages/superset-ui-core/src/connection/SupersetClient.ts
    • superset-frontend/packages/superset-ui-core/src/connection/SupersetClientClass.ts
    • superset-frontend/packages/superset-ui-core/src/connection/types.ts
    • superset-frontend/packages/superset-ui-core/test/connection/SupersetClient.test.ts
    • superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts
    • superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx
    • superset-frontend/src/components/Chart/chartAction.ts
    • superset-frontend/src/explore/components/controls/DatasourceControl/index.tsx
    • superset-frontend/src/explore/components/controls/ViewQueryModalFooter.tsx
    • superset-frontend/src/explore/exploreUtils/exportChart.test.ts
    • superset-frontend/src/explore/exploreUtils/index.ts
    • superset-frontend/src/pages/Login/Login.test.tsx
    • superset-frontend/src/pages/Login/index.tsx
    • superset-frontend/src/pages/Register/Register.test.tsx
    • superset-frontend/src/pages/Register/index.tsx
    • superset/views/utils.py
    • tests/integration_tests/test_subdirectory_deployments.py
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@EnxDev

EnxDev commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Superset uses Git pre-commit hooks courtesy of pre-commit. To install run the following:

pre-commit install

This will install the hooks in your local repository. From now on, a series of checks will automatically run whenever you make a Git commit. To run pre-commit manually run the following:

pre-commit run --all-files

@martyngigg

Copy link
Copy Markdown
Contributor Author

@EnxDev Thanks. I had pre-commit enabled but it seems to pass when the CI checks fail it, which I find confusing.

The failures that currently show up don't show up for me either. I'm not sure why.

@bito-code-review

bito-code-review Bot commented Feb 19, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #493a19

Actionable Suggestions - 0
Review Details
  • Files reviewed - 17 · Commit Range: cc8f486..abf5c08
    • superset-frontend/packages/superset-ui-core/src/connection/SupersetClient.ts
    • superset-frontend/packages/superset-ui-core/src/connection/SupersetClientClass.ts
    • superset-frontend/packages/superset-ui-core/src/connection/types.ts
    • superset-frontend/packages/superset-ui-core/test/connection/SupersetClient.test.ts
    • superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts
    • superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx
    • superset-frontend/src/components/Chart/chartAction.ts
    • superset-frontend/src/explore/components/controls/DatasourceControl/index.tsx
    • superset-frontend/src/explore/components/controls/ViewQueryModalFooter.tsx
    • superset-frontend/src/explore/exploreUtils/exportChart.test.ts
    • superset-frontend/src/explore/exploreUtils/index.ts
    • superset-frontend/src/pages/Login/Login.test.tsx
    • superset-frontend/src/pages/Login/index.tsx
    • superset-frontend/src/pages/Register/Register.test.tsx
    • superset-frontend/src/pages/Register/index.tsx
    • superset/views/utils.py
    • tests/integration_tests/test_subdirectory_deployments.py
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@martyngigg

Copy link
Copy Markdown
Contributor Author

I think the pre-commit job on master is broken as merging in master here as caused the oxlint failures to show up.

@sadpandajoe

Copy link
Copy Markdown
Member

@martyngigg I haven't been working on that branch in awhile, feel free to drop or merge what you need into your branch to move things forward.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses incorrect URL construction when Superset is deployed under a non-root SUPERSET_APP_ROOT by updating how form POSTs and login redirects determine their effective URL, preventing “double app_root” prefixes and improving subdirectory deployment behavior.

Changes:

  • Update SupersetClient.postForm to accept either an endpoint or a full url (resolved via getUrl) and migrate call sites/tests.
  • Fix redirect_to_login so the next parameter includes request.script_root for subdirectory deployments.
  • Update Login/Register/Explore flows and corresponding tests to respect app root in links and form submissions.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/integration_tests/test_subdirectory_deployments.py Adds coverage to ensure redirect_to_login() includes app root and preserves query strings.
superset/views/utils.py Prefixes next targets with request.script_root to support subdirectory deployments.
superset-frontend/src/pages/Register/index.tsx Uses ensureAppRoot for login link and updates postForm call to new config signature.
superset-frontend/src/pages/Register/Register.test.tsx Adds assertions for login link href with/without app root.
superset-frontend/src/pages/Login/index.tsx Ensures provider/register links respect app root and updates postForm usage.
superset-frontend/src/pages/Login/Login.test.tsx Adds coverage for app-rooted register/oauth URLs and updated postForm signature.
superset-frontend/src/explore/exploreUtils/index.ts Uses SupersetClient.getUrl for v1 export URL and updates postForm usage.
superset-frontend/src/explore/exploreUtils/exportChart.test.ts Updates mocks to use SupersetClient.getUrl instead of legacy app-root logic.
superset-frontend/src/explore/components/controls/ViewQueryModalFooter.tsx Migrates postForm call to config object signature.
superset-frontend/src/explore/components/controls/DatasourceControl/index.tsx Migrates postForm call to config object signature.
superset-frontend/src/components/Chart/chartAction.ts Migrates SQL Lab redirect postForm call to config object signature.
superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx Updates expectation for new postForm({ url, payload }) call shape.
superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts Updates postForm tests to use new config signature.
superset-frontend/packages/superset-ui-core/test/connection/SupersetClient.test.ts Adds getUrl exposure test and updates configure-flow expectations.
superset-frontend/packages/superset-ui-core/src/connection/types.ts Introduces PostFormConfig types to support endpoint or url inputs.
superset-frontend/packages/superset-ui-core/src/connection/SupersetClientClass.ts Refactors postForm to accept config object and resolve URLs via getUrl.
superset-frontend/packages/superset-ui-core/src/connection/SupersetClient.ts Exposes getUrl on the exported SupersetClient singleton.
Comments suppressed due to low confidence (1)

superset-frontend/packages/superset-ui-core/test/connection/SupersetClient.test.ts:55

  • The test for “throws before configure” doesn’t include the newly exposed SupersetClient.getUrl method. To keep this test aligned with the public API surface (and to prevent regressions), add an assertion that SupersetClient.getUrl throws when called before configure().
  test('throws if you call init, get, post, postForm, isAuthenticated, and reAuthenticate before configure', () => {
    expect(SupersetClient.init).toThrow();
    expect(SupersetClient.get).toThrow();
    expect(SupersetClient.post).toThrow();
    expect(SupersetClient.postForm).toThrow();
    expect(SupersetClient.isAuthenticated).toThrow();
    expect(SupersetClient.reAuthenticate).toThrow();
    expect(SupersetClient.request).toThrow();

Comment on lines +119 to 129
async postForm(postFormConfig: PostFormConfig) {
if (postFormConfig.endpoint || postFormConfig.url) {
await this.ensureAuth();
const hiddenForm = document.createElement('form');
hiddenForm.action = this.getUrl({ endpoint });
hiddenForm.action = this.getUrl({
endpoint: postFormConfig.endpoint,
url: postFormConfig.url,
});
hiddenForm.method = 'POST';
hiddenForm.target = target;
hiddenForm.target = postFormConfig.target ?? '_blank';
const payloadWithToken: Record<string, any> = {

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SupersetClientClass.postForm now only accepts a config object, which is a breaking change for any external consumers still calling postForm(endpoint, payload, target). At runtime, passing a string will also silently no-op because postFormConfig.endpoint/url will be undefined on a string. Consider supporting the legacy positional signature (with a deprecation path) or throwing a clear error when the argument is not an object containing endpoint or url.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed—the object-only signature makes existing JavaScript callers silently skip form submission, while TypeScript callers stop compiling. Could we retain a deprecated positional overload until a breaking-release migration?

Comment on lines +384 to +388
SupersetClient.postForm({
url,
payload: {
form_data: safeStringify(payload),
},

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url is typed as string | null, but it’s passed directly to SupersetClient.postForm({ url, ... }). Even though runtime control flow ensures url should be non-null here, TypeScript won’t necessarily narrow it across branches and this can break builds (and also allows onStartStreamingExport to receive a nullable URL type). Consider adding a single non-null guard after the legacy/v1 branch (or refactoring so url is a plain string by this point).

Copilot uses AI. Check for mistakes.
@rusackas

Copy link
Copy Markdown
Member

@martyngigg this one's gone stale and conflicts with master now, plus pre-commit and a jest shard are red. Mind rebasing and pushing so I can get it green and reviewed? The Bito XSS flag looks like a false positive to me since those are form field values, not HTML.

@rusackas

Copy link
Copy Markdown
Member

@martyngigg I can't push to your fork to rebase this, as it turns out. The postForm fix itself seems right to me, if you can help move this forward in mergeability.

@rusackas

Copy link
Copy Markdown
Member

CC @sadpandajoe who's working on a whole swath of app root fixes, and may want to take this PR into account.

@sadpandajoe

Copy link
Copy Markdown
Member

@martyngigg here is the new pr: #39925. Should have a bunch of changes, feel free to review it. As it could be a breaking change, i'll merge once the breaking change window opens.

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Aug 1, 2026
const appRoot = '/superset';
ensureAppRoot.mockImplementation((path: string) => `${appRoot}${path}`);
// Uses SupersetClient.getUrl
SupersetClient.getUrl.mockImplementation(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The /superset coverage here only uses onStartStreamingExport, so it bypasses the fallback changed in exportChart that submits through postForm. A regression that re-prefixes the resolved URL or passes it as an endpoint would make non-streaming exports 404 under a subdirectory while these tests still pass. Could this also assert, without a streaming handler, that postForm receives { url: '/superset/api/v1/chart/data' }?

@rusackas

rusackas commented Sep 5, 2026

Copy link
Copy Markdown
Member

@martyngigg still can't push to your fork to fix this one myself. sadpandajoe's app-root fixes have been landing in pieces (#39925, #41759, #42015) but none of them touch SupersetClient.postForm, so this still looks like the right fix, it just needs a rebase and pre-commit/jest cleared.

@rusackas

rusackas commented Sep 9, 2026

Copy link
Copy Markdown
Member

Looking again at this. You did a nice job pulling the two older attempts together, but I don't think this is actually mergeable as-is. Changing postForm from positional args to a single config object is a breaking change for anyone still calling it the old way, it'll silently no-op instead of throwing. Copilot flagged that back in March and @sadpandajoe asked about keeping a deprecated positional overload in August, but neither's been answered yet. Also still conflicting with master, and CodeQL plus pre-commit are both red on the latest run. Probably worth settling the API question before we get into the rebase... I can't push commits here, so we'll need your help to move it forward.

await client.init();

await client.postForm(mockPostFormUrl, {});
await client.postForm({ url: mockPostFormUrl, payload: {} });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The url cases check tokens and payloads but never the form action, so forwarding a resolved URL as an endpoint again would double the app-root prefix while these tests still pass. Could we add a non-empty appRoot case for postForm({ url: "/prefix/post_form/url", payload: {} }) and assert that the submitted action stays /prefix/post_form/url?

} else {
SupersetClient.postForm(ensureAppRoot(redirectUrl), {
form_data: safeStringify(payload),
SupersetClient.postForm({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing endpoint tests start with a bare path, so they would not catch this caller adding the app-root prefix again and sending SQL Lab navigation to /analytics/analytics/sqllab/. Could chartActions.test.ts exercise redirectSQLLab without history under a non-empty app root and assert the bare /sqllab/ endpoint plus the serialized query payload?

@EnxDev EnxDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared this against current master, and most of it has already landed through other PRs: the redirect_to_login fix and its tests, the app-root links on Login and Register, and master's getUrl now strips a pre-applied root, so the double prefix on endpoint callers is handled at runtime. What master still needs is the url option. exploreChart hands getExploreUrl's absolute URL to postForm as an endpoint, so the SQL Lab CTAS Explore button posts to something like https://host/<root>/https://host/explore/....

The open blocker is still the signature question raised earlier in the thread. Master has also picked up a new positional caller in DrillDetailPane.tsx:254 that this branch doesn't migrate, which is a good example of what breaks downstream. Accepting string | PostFormConfig and normalizing the string form inside postForm would keep old callers working while the new shape lands.

Left three notes inline that should help with the rebase.

await this.ensureAuth();
const hiddenForm = document.createElement('form');
hiddenForm.action = this.getUrl({ endpoint });
hiddenForm.action = this.getUrl({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Master wraps this in sanitizeUrl(...) now, which is the CodeQL fix and probably why CodeQL is red here.

Worth keeping when you resolve the conflict, more so now that url passes straight through getUrl untouched.

payload = formData;
} else {
url = ensureAppRoot('/api/v1/chart/data');
url = SupersetClient.getUrl({ endpoint: '/api/v1/chart/data' });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On master exportChart doesn't go through postForm anymore. The legacy branch went away with the explore_json removal and the non-streaming path uses postBlob.

So this hunk and the exportChart.test.ts changes can likely take master's side on rebase. exploreChart below is the part that still matters.

Comment on lines +139 to +141
}).finally(() => {
setLoading(false);
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postForm resolves as soon as submit() fires, so this clears the spinner while the login POST is still navigating and the button is clickable again.

If the point is to recover when ensureAuth() rejects, .catch covers that without the flicker.

Suggested change
}).finally(() => {
setLoading(false);
});
}).catch(() => {
setLoading(false);
});

@rusackas

Copy link
Copy Markdown
Member

@martyngigg thanks for sticking with this one. I think @EnxDev's read is right, master already picked up most of it, so what's left is mainly the url option on postForm for the CTAS Explore button. If you can rebase and take the string | PostFormConfig route so old positional callers keep working (including the new one in DrillDetailPane), I think we can get this over the line. Holler if you'd rather one of us carry it from a fresh branch.

@rusackas

Copy link
Copy Markdown
Member

Closing this as obsolete, everything here has landed on master by now, the last piece (the postForm app-root doubling) just went in via #45204. Thanks for the original catch @martyngigg, and for sticking with it!

@rusackas rusackas closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend packages requires:rebase Requires rebasing on top of current master size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants