Skip to content

fix(dashboard): Remove 308 redirect when creating new dashboards #28754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ericsong
Copy link

SUMMARY

Currently, a request for a new dashboard (hitting /dashboard/new) will respond with a 308 permanent redirect because the UI hits /dashboard/new even though the backend exposes /dashboard/new/


Flask handles this case by responding with a 308 to the exposed version https://flask-cn.readthedocs.io/en/stable/api/#flask.Flask.route.

This PR changes routes in the frontend from /dashboard/new to /dashboard/new/ so that requests can be made without a 308 redirect.

In our infrastructure setup, there's a problem with the 308 redirect and it points to an invalid address. I believe others have seen this problem as well in this issue #20577.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Reproduction Steps

  1. Hard refresh to remove cached response to /dashboard/new redirection
  2. Create a new dashboard

Before
Screenshot 2024-05-28 at 9 05 32 PM

After
Screenshot 2024-05-28 at 9 20 03 PM

TESTING INSTRUCTIONS

See Reproduction Steps in section above

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

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@ericsong
Copy link
Author

Alternatively, we could change the backend

to expose /new instead of /new/ and I think that would work too.

@rusackas rusackas requested a review from dpgaspar May 29, 2024 16:08
@ericsong
Copy link
Author

hey! @rusackas @dpgaspar

just wanted to follow up on this

@mmpepin
Copy link

mmpepin commented Nov 12, 2024

Hello @rusackas @dpgaspar. We have the same issue on version 4.0. Is there anything planned to fix this? Thanks!

Copy link

Hello everyone, I would like to know if this PR has been reviewed or if an alternative solution has been found? We currently have the same issue (superset version 4.0.6).

@landryb
Copy link
Contributor

landryb commented Feb 3, 2025

Alternatively, we could change the backend


to expose /new instead of /new/ and I think that would work too.

fwiw, it should also be possible to add @expose('/new') next to @expose('/new/'), this way both routes work, that's backwards-compatible, and doesn't need fixing in the frontend. I've tested it locally.

landryb added a commit to georchestra/superset-core that referenced this pull request Feb 3, 2025
landryb added a commit to georchestra/superset-core that referenced this pull request Feb 3, 2025
jeanpommier pushed a commit to georchestra/superset-core that referenced this pull request Apr 8, 2025
jeanpommier pushed a commit to georchestra/superset-core that referenced this pull request Apr 10, 2025
@malcolm061990
Copy link

HI @dpgaspar
Can please someone review this PR?

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 dashboard Namespace | Anything related to the Dashboard size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants