fix(launch): render object map values as JSON instead of crashing on relaunch#922
Open
1fanwang wants to merge 1 commit into
Open
fix(launch): render object map values as JSON instead of crashing on relaunch#9221fanwang wants to merge 1 commit into
1fanwang wants to merge 1 commit into
Conversation
…relaunch A map whose values are objects (e.g. Map[str, Struct]) parsed each value into the string-typed value field, so the launch form bound an object straight into a text input -- coerced to "[object Object]" and producing render errors on relaunch. JSON-stringify object values at parse time so the field always receives a string. Signed-off-by: 1fanwang <1fannnw@gmail.com>
|
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
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.
TL;DR
Relaunching an execution whose input is a
Map[str, Struct]breaks the launch form: the map's object values render as[object Object], the inputs are flagged invalid, and Launch is disabled — so you can't relaunch at all.Type
Are all requirements met?
Complete description
The map's values are objects, but
parseMappedTypeValuedrops each one straight into a text field, where it stringifies to[object Object]and trips a render error. The field is typedstring, so the fix belongs at the parse boundary, not the JSX: JSON-stringify object values as the map is parsed, so the field, its validation, and the round-trip back to a literal all see a string. Plain strings and numbers pass through untouched.Smoke-tested on a live console: relaunch an execution with a
map<string, struct>input. Before, the value fields read[object Object], are flagged invalid, and Launch is disabled; after, they read{"nested":"bar"}/{"k":1}and Launch works.MapInput.test.tsxcovers it.Tracking Issue
NA
Follow-up issue
NA