Files
PowerToys/src/runner
Niels Laute a4d10fc859 fix(settings-ui): prevent update checks from resetting modules (#50018)
## Summary of the Pull Request

Prevents update checks from resetting enabled module states when
Settings UI holds stale or default general settings.

The update check now sends the existing action-only IPC shape from
`src/settings-ui/Settings.UI/ViewModels/UpdateViewModel.cs`. Runner
handles that command without applying its payload as general settings in
`src/runner/settings_window.cpp`.

## PR Checklist

- [x] Closes: #48907
- [x] **Communication:** Root cause analysis was posted on the linked
issue
- [x] **Tests:** Added/updated and all pass

## Detailed Description of the Pull Request / Additional comments

Previously, `CheckForUpdates()` embedded the complete mutable
`GeneralSettings` object in a custom-action message. Runner then called
`apply_general_settings` on that action payload. If Settings UI had
loaded fallback defaults, merely checking for an update could persist
those defaults and overwrite the user's enabled module choices.

This change:

- sends only `{ "action": { "general": { "action_name":
"check_for_updates" } } }`;
- prevents Runner from treating an update action as a general-settings
update;
- preserves prerelease behavior because changing that setting already
sends normal general-settings IPC before starting the update check; and
- updates
`src/settings-ui/Settings.UI.UnitTests/ViewModelTests/Update.cs` to
verify non-default module states are neither transmitted nor mutated.

No persisted settings schema, localization, documentation, or binary
changes are required.

## Validation Steps Performed

- Built
`src/settings-ui/Settings.UI.UnitTests/Settings.UI.UnitTests.csproj` for
x64 Debug.
- Ran `ViewModelTests.Update` with `vstest.console.exe`: 26 passed.
- Built `src/runner/runner.vcxproj` for x64 Debug.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 14:14:48 +08:00
..
2026-04-23 06:48:20 +02:00
2026-01-26 09:44:10 +08:00