Repository navigation
fix: preserve invalid configuration during automatic updates - #151
Merged
Merged
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.
Automatic config updates could replace malformed JSON or non-object values with a new object, losing the existing settings. Updates now reject those files before writing and report the affected path with repair guidance, without echoing config contents. Read failures also refuse the update; only a genuinely missing file initializes a new config. Valid updates continue to preserve unrelated fields.
This is the bounded config-write safety prerequisite for the native configuration work. It does not add schema-version handling, change config formats, or migrate runtime state. Existing read-only fallback behavior is unchanged.
Validation: Bun 1.4.2; 37 focused config/env tests passed, including all three writer entry points, an unreadable-but-writable file, and a real CLI refusal. Full typecheck and check passed (CLI tasks executed; unchanged DB tasks reused cache). The compiled current-branch CLI independently rejected malformed config, preserved its bytes, and omitted its contents from diagnostics. Full test gate passed: CLI 2,091 passed, 68 skipped, 0 failed; unchanged DB test task reused cache (2 passed). Skips are the existing optional integration prerequisites and do not qualify native runtime behavior.
Release intent: patch correction to automatic settings persistence; no migration required.
Refs https://linear.app/hackdance/issue/HACK-1218
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.