Bug Description
reset in src/commands/config/getSetReset.ts (lines 38-50)
contains a completely useless delete config[key] statement
that modifies a local object which is never written back to disk.
Root Cause
reset(key: string): void{constconfig=this.getConfig();// reads fresh config from diskif(!(keyinconfig)){this.failSpinner(`Configuration key '${key}' does not exist.`);return;}deleteconfig[key];// modifies LOCAL object — NEVER persistedthis.writeConfig(key,undefined);// reads ANOTHER fresh config from diskthis.succeedSpinner(`Configuration successfully reset`);}Impact
The delete config[key] on line 47 is dead code — it modifies
a local variable that is immediately discarded. writeConfig
then reads a completely fresh copy from disk anyway. This suggests
a logic misunderstanding that could cause real bugs if someone
refactors this code expecting the delete to have been persisted.
Suggested Fix
reset(key: string): void{constconfig=this.getConfig();if(!(keyinconfig)){this.failSpinner(`Configuration key '${key}' does not exist.`);return;}// Remove dead code - writeConfig handles persistencethis.writeConfig(key,undefined);this.succeedSpinner(`Configuration successfully reset`);}File
src/commands/config/getSetReset.ts lines 38-50
Severity: Medium
Bug Description
resetinsrc/commands/config/getSetReset.ts(lines 38-50)contains a completely useless
delete config[key]statementthat modifies a local object which is never written back to disk.
Root Cause
Impact
The
delete config[key]on line 47 is dead code — it modifiesa local variable that is immediately discarded.
writeConfigthen reads a completely fresh copy from disk anyway. This suggests
a logic misunderstanding that could cause real bugs if someone
refactors this code expecting the delete to have been persisted.
Suggested Fix
File
src/commands/config/getSetReset.tslines 38-50Severity: Medium