Fix app crash when run commands contain non-string values#3098
Fix app crash when run commands contain non-string values#3098denjalonso wants to merge 1 commit into
Conversation
The `getResolvedRunCommands` procedure passed `config.run` directly to
the renderer without validating that entries are strings. When users
configure run commands as objects (e.g. `{ name, command }`) instead of
plain strings, `WorkspaceRunButton` crashes calling `.trim()` on a
non-string value, rendering the entire app unusable.
Filter `config.run` to only include non-empty strings before returning,
consistent with how `hasConfiguredScripts` already handles this.
Fixes superset-sh#3095
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hey @kirankunigiri, could you take a look at this? The crash originates from the |
Summary
TypeError: command.trim is not a functioncrash inWorkspaceRunButtonwhen.superset/config.jsoncontains objects instead of plain strings in therunarrayconfig.runentries ingetResolvedRunCommandsto only include non-empty strings, consistent with howhasConfiguredScriptsalready handles thisFixes #3095
Root Cause
getResolvedRunCommandsreturnedconfig.rundirectly without validation:When a user writes their config as:
{ "run": [{ "name": "Dev", "command": "npm run dev" }] }The renderer receives objects instead of strings, and
WorkspaceRunButtoncrashes calling.trim()on them — making the entire app unusable (black screen).Fix
Filter to only valid string entries before returning, matching the existing pattern in
hasConfiguredScripts:Test plan
.superset/config.jsonwith object-format run commands ({ name, command }) — app should no longer crashrun: []— no crash, run button shows "Set Run"🤖 Generated with Claude Code
Summary by cubic
Fixes an app crash when
.superset/config.jsoncontains non-string entries inrunby returning only non-empty string commands from getResolvedRunCommands, preventing.trim()errors in the Workspace Run button.config.runto non-empty strings; ignore objects and blanks.hasConfiguredScriptsvalidation and preserves normal run button behavior.Written for commit 68cf238. Summary will update on new commits.
Summary by CodeRabbit