fix(deploy): prevent double-prefix of logo URL in subdirectory deployments#39472
Conversation
…logo to prevent double-prefix in subdirectory deployments Fixes apache#39432 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Review Agent Run #c5c7e7Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #39472 +/- ##
=======================================
Coverage 64.49% 64.49%
=======================================
Files 2557 2557
Lines 133191 133182 -9
Branches 30935 30931 -4
=======================================
Hits 85897 85897
+ Misses 45804 45795 -9
Partials 1490 1490
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…logo-double-prefix-39432
|
Hi @rusackas @michael-s-molina @aminghadersohi — when you have a moment, mind taking a look? CI is green and the fix is small (just removes redundant backend prefixing since the frontend already handles it via |
|
Getting an issue with RC2 specifying a URL to i.e. Causes error boostrapping the frontend installHook.js:1 Unhandled error during app initialization TypeError: Cannot read properties of undefined (reading 'startsWith') |
|
Thanks @onionhammer — this looks like a separate bug. Your crash is from |
…ments (apache#39472) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SUMMARY
When deploying Superset under a subdirectory (e.g.
SUPERSET_APP_ROOT=/dashboards), the logo image returns a 404 because the URL is double-prefixed:Root cause
Two independent mechanisms each add the
app_rootprefix:superset/app.py(introduced in fix: add subdirectory deployment support for app icon and reports urls #35098) manually prefixesAPP_ICON,brandLogoUrl, andbrandLogoHrefwithapp_root.ensureStaticPrefix()insuperset-frontend/src/utils/assetUrl.tsandensureAppRoot()insrc/utils/pathUtils.tsalso prependapp_rootto any path starting with/when rendering these values inMenu.tsx.Since both mechanisms run independently, the prefix is applied twice.
Fix
Remove the manual backend prefixing block in
superset/app.py. The frontend helpers already handle subdirectory deployments correctly:brand.icon→ensureStaticPrefix(Menu.tsx)theme.brandLogoUrl→ensureStaticPrefix(Menu.tsx)theme.brandLogoHref→ensureAppRoot(Menu.tsx)Related issues
BEFORE / AFTER SCREENSHOTS OR ANIMATED GIF
Before — Logo is broken (404) when deployed under
/dashboards. Network request shows .After — Logo loads correctly. Network request shows
/dashboards/static/...(single prefix).TESTING INSTRUCTIONS
APPLICATION_ROOT = "/dashboards"(orSUPERSET_APP_ROOT=/dashboards) in your confighttp://localhost:8088/dashboards//dashboards/static/assets/images/superset-logo-horiz.png(single/dashboards/prefix)ADDITIONAL INFORMATION