Repository navigation
[Bug] Settings write fails ("Failed to save settings") due to case-sensitivity mismatch in Windows installation path #10532
AnyaForger114514
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Bug Description
When using DSH Desktop version
0.2.1-rc.2on Windows, attempting to change settings (models, themes, preferences) in the UI fails and shows "Failed to save settings, please retry" (未能保存设置,请重试).After deep debugging (with the help of an AI agent), we found the root cause is module duplication caused by case-sensitivity inconsistencies in the Windows installation path.
Environment
@deepseek-ai/dsh-desktop 0.2.1-rc.2E:\ruanjian\DSH(Notice the uppercaseDSH)Root Cause Analysis
bootstrapIncludesis a module-level WeakMap insidedsh-app-boot.app.getAppPath(), which returns a lowercase string (E:/ruanjian/dsh/...).E:\ruanjian\DSH), and Node/realpath normalizes it to uppercase.dshvsDSH), creating two separate module instances (and two separate WeakMaps).bootstrapIncludes.set()is called in instance A, but theconfig-editor/hmrmodules querybootstrapIncludes.get()from instance B.dsh: profile reload requires the root Include entry, and allsettings/mutateRPCs fail silently with a UI rollback.Proof / Control Experiment
DSHsettings/updateok=trueDSHsettings/updaterejected (Module split)dsh(Renamed)settings/updateok=trueWorkaround (Temporary Fix)
E:\ruanjian\DSH->E:\ruanjian\dsh).Suggested Fix
Consider normalizing the path and resolving symlinks before caching in
dsh-app-boot:fs.realpathSync.native()orpath.normalize()to force consistency before ESM resolution.bootstrapIncludesin a global symbol (e.g.,Symbol.for('dsh.bootstrapIncludes')) onglobalThisto prevent module instance duplication.Note: This issue was discovered and debugged by a user. Huge thanks to the community for the help!
All reactions