Repository navigation
settings: skip unchanged saves so external edits are not swallowed - #3504
Merged
bbedward merged 1 commit intoSep 20, 2026
Merged
Conversation
saveSettings() set _selfWrite before setText(). When the serialized settings were identical to the file, nothing was written, no fileChanged followed, and the flag stayed set. The next external edit of settings.json was then taken for our own write and never reloaded. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Member
|
/claude review |
Contributor
Claude reviewNo issues found. Checked: the |
bbedward
pushed a commit
that referenced
this pull request
Oct 7, 2026
…3504) saveSettings() set _selfWrite before setText(). When the serialized settings were identical to the file, nothing was written, no fileChanged followed, and the flag stayed set. The next external edit of settings.json was then taken for our own write and never reloaded. (cherry picked from commit 84594e6)
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.
Description
SettingsData.saveSettings()sets_selfWrite = trueand then callssettingsFile.setText(...). When the serialized settings are identical to the file content, nothing is written, nofileChangedfollows, and_selfWritestaystrue. The next external edit ofsettings.jsonis then taken for DMS's own write:onFileChangedclears the flag and returns without reloading.It is easy to hit. Any
setwith an unchanged value leaves the flag set, for exampledms ipc call settings set cornerRadius 12while it already is12. Tools that writesettings.jsonfrom outside (profile switchers, dotfile managers, a text editor) then see their first change ignored until DMS saves again or restarts.The fix compares the serialized JSON with
settingsFile.text()and returns early when nothing changed, so the flag is only set when a write happens.How to reproduce on current master:
dms ipc call settings set cornerRadius <current value>(the file's mtime does not change)cornerRadiusinsettings.jsonfrom outsideWith this change, step 3 reloads as expected.
Type of change
Related issues
None found.
Checklist
saveSettings()as master: unchanged value writes nothing and leaves the flag false, changed value writes and the followingfileChangedis consumed as before, an external edit afterwards reloads)make lint-qmlnot run, I do not have the dev shell set upI found and fixed this with help from Claude (Anthropic). I reproduced the bug, read the change and tested it myself.
🤖 Generated with Claude Code