Repository navigation
Conversation
When ~/.config/omarchy/shell.json becomes empty or unparseable at runtime after a valid user config was already applied, applyShellConfig retained nothing and fell back to builtin defaults. The next mutateShellConfig then persisted stock layout and wiped third-party plugins. Retain the last valid in-memory user config (with a warn) while still allowing first-load fallback when nothing valid was ever loaded. Fixes omacom#12990.
|
Tested in the Omarchy VM running Omarchy 4.0.4-1 with Quickshell 0.3.1:
Everything works as expected with no regressions. |
|
No actionable defect found in the inspected change at Verified from source: after a valid version-1 user configuration has loaded, empty or invalid reloads leave the current configuration intact. Subsequent shell-side mutations therefore use that retained configuration rather than the defaults. A later valid configuration is still accepted.
Scope limits: retention is in memory, not an on-disk backup. Restarting while the file remains empty still takes the first-load defaults path. Separate disk-based writers, such as Review informationTest scope: source inspection of the configuration reload/mutation paths and the added source-pattern test. No tests or Quickshell/FileView runtime behavior were executed; the original truncation was not reproduced. Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review. Automated AI review: Astra Medium initial inspection, independent Opus 5.5 High and GPT 6 Sol Xhigh technical assessments, then Astra Medium synthesis checked against the pinned source. |
The pin matched source strings, so it passed with shellConfig = defaults reinserted above the guard and failed on a reworded warning. This drives a live Quickshell instead: a valid load, an emptied file, a shell-side write, an unparseable file, then a later valid file, and it fails on quattro's applyShellConfig. Each retention check waits for the shell to log that it retained, so it cannot pass before the reload lands. It starts from a valid file because quattro's shell writes defaults into an empty one shortly after startup (omacom#11349), which would race the first write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
| return 1 | ||
| } | ||
|
|
||
| write_user_config first |
There was a problem hiding this comment.
First-load fallback is untested
The test always starts with a valid shell.json, so it never checks what happens when the file is empty or invalid before any valid config has loaded. A future change could break that fallback while this test still passes. Add fresh-shell cases for empty and invalid files, and check that the shipped defaults apply.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Reviewed, and the fix works. I reproduced #12990 on a disposable Omarchy VM with a live Quickshell: load a valid I pushed one commit to your branch, fc6a7cd. It replaces
The second opinion was Codex Medium, over three rounds. It agreed the For the maintainer:
This is waiting on the maintainer. |
|
This has stopped merging cleanly with #13104 fixes the same bug, and I've judged it the one to bring forward rather than this one. The project's default is that the older fix wins, but this one misses two cases #13104 handles:
#7723 retains the old config only when the JSON fails to parse, so it doesn't cover an emptied file. This PR has something #13104 lacks: a test that runs a real shell through valid load, empty file, shell-side write, and checks what that write saved. I've asked for that check to be folded into #13104, in The second opinion, Codex Medium, was given all three PRs and #14534 without my conclusion, and also picked #13104, for the same two reasons. It did not run a shell. Its independence from this review is not guaranteed. I didn't push anything here or run it on a worker this time, since it isn't the fix being taken forward. Choosing between the two is the maintainer's call, and this one waits on that. |
…moke test Empties the scratch shell's shell.json, waits for the shell to report it kept its config, then makes a bar change and requires the file to carry the loaded layout and the change. On quattro the reload drops to the defaults and the change writes them over the user's layout. The approach is omacom#12992's runtime test, moved into the existing smoke test. Co-Authored-By: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing in favour of #13104, which also handles a deleted shell.json and the CLI writers seeding an empty file. The real-shell regression here (valid load, empty file, shell-side write) is free for #13104 to fold into runtime-smoke-test.sh. Prepared by Claude Opus 5.5 via Hermes Agent; reviewed under kvnloo's account. |
Fixes #12990.
What changed
applyShellConfig()now tracks when a versioned usershell.jsonhas been successfully applied (hasAppliedUserShellConfig). If a later reload sees empty/whitespace or unparseable user text after that, it retains the last valid in-memoryshellConfigand logs a warn instead of replacing with builtin defaults.Genuine first-load fallback to defaults is unchanged when nothing valid was ever loaded.
Why still needed
A runtime truncation of
~/.config/omarchy/shell.json(after a valid load) used to flipshellConfigto stock defaults. The nextmutateShellConfig/persistShellConfigthen permanently wrote that stock config (bar reset, third-party plugins disabled). Distinct from the #11349 startup race.Tests
test/shell.d/shell-config-empty-retain-test.sh— source pin for the retain guard (flag, warn+return, nouser || defaultsclobber, first-load defaults still allowed)bash test/shell.d/shell-config-empty-retain-test.sh→okTip:
d3cfd53b997f8bdcf776b8db68bf0d735e7a065d(upstream/quattro)Credit / provenance