Conversation
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.
Description
Fixes a runtime and a build issue in the webapp form. When
settings.commandcomes from the API as an array (e.g.["python", "app.py"]) instead of a string, calling.trim()inhasAdvancedChangescausedUncaught TypeError: settings.command.trim is not a function. The logic now supports both string and array: string is trimmed and checked for non-empty; array is checked for at least one non-empty element. TypeScript was narrowingcommandtoneverin the array branch (type isstring | null), socmdis typed asunknownin the helper and the.some()callback parameter is typed asunknownto fix tsc errors and allow the runtime array check.Related Issue
Closes #
Type of Change
Component Affected
Checklist
General
Testing
Documentation
Screenshots (if applicable)
N/A — logic-only fix.
Test Plan
settings.commandas an array; confirm no console error and the "Advanced Settings" / "Modified" badge behave as before.commandas a string ornull; confirm behavior unchanged.npm run build(ortsc --noEmit) in the portal and confirm no TypeScript errors.Additional Notes
WebappSettings.commandstaysstring | nullin the types; the API can still return an array, so the code treatscommandasunknownonly inside thehasAdvancedChangeshelper for safe runtime handling.