fix(frontend): handle null/undefined path in ensureAppRoot#39940
Conversation
Code Review Agent Run #4c3ab1Actionable Suggestions - 0Additional Suggestions - 1
Review 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 |
1ab0fba to
25c468b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #39940 +/- ##
==========================================
- Coverage 64.16% 64.16% -0.01%
==========================================
Files 2591 2591
Lines 138283 138285 +2
Branches 32083 32085 +2
==========================================
+ Hits 88726 88727 +1
- Misses 48027 48028 +1
Partials 1530 1530
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:
|
Code Review Agent Run #83899dActionable Suggestions - 0Additional Suggestions - 1
Review 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 |
|
The PR diff shows a change to superset-frontend/src/utils/pathUtils.ts |
25c468b to
5242926
Compare
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
… app crash on partial theme overrides
… in ensureAppRoot
5242926 to
0a98f45
Compare
|
@hainenber Thanks for the review — addressed:
|
Code Review Agent Run #b8d5eeActionable 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 |
|
LGTM. Thanks for your contribution! @Abdulrehman-PIAIC80387 |
|
Bito Automatic Review Skipped – PR Already Merged |
SUMMARY
ensureAppRoot()insuperset-frontend/src/utils/pathUtils.tscallspath.startsWith(...)on its input without first checking thatpathis defined. When a caller (e.g.Menu.tsxrendering the brand link) passestheme.brandLogoHrefthat isundefined, the entire app crashes during initialization with:This happens in real-world setups where a user partially overrides
THEME_DEFAULT/THEME_DARKinsuperset_config.py— Python replaces the entiretokendict rather than merging, so tokens likebrandLogoHrefend up unset.Fix: widen the parameter type to accept
null | undefinedand fall back to the application root (or'/') when the path is missing. The app stays alive instead of going to a blank screen.Fixes #39855
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
After:
TESTING INSTRUCTIONS
Add this to
superset_config.py:Cannot read properties of undefined (reading 'startsWith').ADDITIONAL INFORMATION