Repository navigation
fix: preserve Unicode whitespace in variable edit documents - #1310
Draft
Kayvan-Zahiri wants to merge 1 commit into
Draft
Kayvan-Zahiri wants to merge 1 commit into
Kayvan-Zahiri wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
railway variable editquotes ASCII spaces/tabs but leaves other whitespace unquoted. The reader uses Rust's Unicode-awaretrim, so saving an unchanged document drops leading/trailing non-breaking, em, thin, narrow non-breaking and ideographic spaces, NEL, vertical tab and form feed. Whitespace-only values become empty. This produces unwanted pending variable updates; the CLI still requires confirmation before applying them.Quote any value containing
char::is_whitespace, matching the reader. Existing special-character escaping remains intact. Add a regression that writes and reads an edit document and checks the resulting variable diff across 32 cases: eight whitespace characters in leading, trailing, whitespace-only and embedded positions. Before, 24 boundary cases lose data; eight embedded controls are preserved. After, all round-trip and unchanged-diff assertions pass. All 16 variable-editor tests pass.Validation on Rust/Cargo 1.98.0 with unchanged Cargo.lock:
cargo test --locked: 1,890 passed, six ignored, across unit and CLI integration suites.cargo fmt --check,git diff --checkand built CLI--version(5.71.0) pass.cargo lint-fixcompletes. Its unrelated rewrites were excluded from this change; finalcargo clippy --locked --all-targets --all-featurescompletes with existing warnings outside the changed lines. The only warning in this file concerns the unchangedrender_variable_plan_plainat line 197.The regression uses local temporary files and synthetic values. Broader integration tests use local fixtures; no Railway project variables or live credentials were used. No release build or hosted account behavior is claimed.