Fix preserve settings during migrations#52676
Merged
probably-neb merged 6 commits intozed-industries:mainfrom Mar 30, 2026
Merged
Fix preserve settings during migrations#52676probably-neb merged 6 commits intozed-industries:mainfrom
probably-neb merged 6 commits intozed-industries:mainfrom
Conversation
…gs during migration
Collaborator
|
Thanks! |
Collaborator
|
@zed-zippy approved |
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.
Context
update_settings_filedeletes unrelated settings when the settings file contains deprecated keys that need migration. For example, changing the model from the Agent Panel overwrites the entireagentblock instead of just updatingdefault_model.The root cause is that
edits_for_updateusedparse_json_with_comments(strict parser), which returnsErron deprecated/unknown fields. The error is swallowed bylog_err(), falling back toDefault::default()(empty settings). The diff then sees everything as new and replaces the entire block.The fix switches to
parse_json(the fallible/lenient parser), which returnsSome(parsed_value)even when deprecated fields are present - the same pattern already used byparse_and_migrate_zed_settings.Fixes #41344
How to Review
Single-file change in
settings_store.rs, focus onedits_for_update. Compare withparse_and_migrate_zed_settings(line 702) which already uses the sameparse_jsonapproach.Self-Review Checklist
Video
Screencast.from.2026-03-21.00-36-12.webm
Note : Reopens previous work from closed PR #52081 (fork was deleted)
Release Notes: