fix: normalize invalid json escapes and compact on pull to prevent canvas blank-screen#7
Merged
Conversation
…nvas blank-screen
sabbah13
approved these changes
May 25, 2026
Owner
sabbah13
left a comment
There was a problem hiding this comment.
LGTM. Reviewed the algorithm and ran full pipeline tests — both bugs (3.7.2-a structural newlines, 3.7.2-b invalid _ escapes) reproduce on pre-PR code and disappear after the fix. Quote-aware walker handles edge cases correctly. Change-detection path stays sound via jsonValuesEqual canonicalization.
6 tasks
sabbah13
added a commit
that referenced
this pull request
May 25, 2026
…storage (v3.7.3) (#8) Workflow Builder canvas blank-screen, take two. Two bug families were leaking through v3.7.1's STRING-coercion fix: (a) yaml.dump of a pretty-printed JSON string emitted a double-quoted scalar with \n escape sequences. patchYamlToPyyaml then rewrote those as a single-quoted scalar where \n became two literal chars, so Builder's JSON.parse choked on backslash-n as structural whitespace. (b) Canvas Markdown body uses \_ for emphasis. \_ is not a valid JSON escape per RFC 8259 and Chrome V8 JSON.parse throws on it, silently blanking the Builder. normalizeJsonValueForStorage now (1) strips invalid escape sequences via a quote-aware walker (fixInvalidJsonEscapes) and (2) compacts the string via JSON.parse + JSON.stringify so the value is single-line and survives yaml.dump -> patchYamlToPyyaml without escape corruption. jsonValuesEqual continues to canonicalize both sides so the new compact form does not spuriously push against pretty remotes. Existing pretty-printed canvases in attributes.yaml will be reformatted to compact form on next pull — one-time stylistic diff, no semantic loss. 25 regression tests in test/json-attribute-roundtrip.test.js cover both bug families and the full pull -> dump -> patch -> reload -> JSON.parse pipeline. Reported by Bob in #7. Closes the canvas blank-screen regression that v3.7.1 only partially fixed. Release surfaces touched: - package.json + package-lock.json (3.7.2 -> 3.7.3) - CHANGELOG.md (new [3.7.3] section + link refs) - README.md (top feature bullet) - CLAUDE.md (Implementation Status bullet + json-attr-utils.ts module entry under Sync Modules) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
|
Shipped as v3.7.3 — thanks Bob! 🎉 npm install -g newo@3.7.3
# or
npm install -g newo@latestSmoke check on an affected customer: newo pull # existing pretty-printed canvases will re-emit compact (one-time stylistic diff)
newo push # canvas now survives the round-trip; Builder no longer blanksRelease notes: CHANGELOG.md#373---2026-05-25 |
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.
No description provided.