winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

DSCv3 user settings file enhancements

Open AmelBawa-msft opened this issue 7 months ago • 0 comments

Comment 1:

I would definitely suggest having the UserSettings code handle the reading/writing of settings file itself. This code doesn't consider the settings backup file; which might be relevant to consider.

The question RE: the backup file becomes, "What are we managing with this resource?". Is it the contents of the primary settings file or is it the logical settings that WinGet will use when run?

Should we refuse to operate if the operation requires reading JSON from the settings file and that file is corrupt?

Comment 2:

Not having a settings file is a legitimate state (in fact, the most likely state on a new system).

Add a test(s) that ensures proper handling when the settings file does not exist.

AmelBawa-msft avatar May 02 '25 06:05 AmelBawa-msft