fix(frontend): handle null/undefined path in ensureAppRoot#39940
Open
Abdulrehman-PIAIC80387 wants to merge 1 commit intoapache:masterfrom
Open
fix(frontend): handle null/undefined path in ensureAppRoot#39940Abdulrehman-PIAIC80387 wants to merge 1 commit intoapache:masterfrom
Abdulrehman-PIAIC80387 wants to merge 1 commit intoapache:masterfrom
Conversation
… app crash on partial theme overrides
Contributor
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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