Skip to content

fix: Settings Watchdog and Camera/Mic/Location look again each time they are shown, and the drift CSV says what Restore will do - #2939

Merged
laurentiu021 merged 1 commit into
mainfrom
fix/watchdog-and-camera-tabs-read-when-shown
Oct 21, 2026
Merged

laurentiu021 merged 1 commit into
mainfrom
fix/watchdog-and-camera-tabs-read-when-shown

Conversation

@laurentiu021

Copy link
Copy Markdown
Owner

Closes #2837.

Confirmed in the code: both view models read in their constructor and then only on Refresh or F5, both are kept until SysManager closes, and neither had an IsActive flag or a case in MainWindowViewModel.SetActive. SettingsWatchdogService.ToCsv wrote CanRestore, which is true for every catalog entry, while Restore has used CanWriteBack since #2594.

The changes:

  • SettingsWatchdogViewModel.IsActive and PrivacyMonitorViewModel.IsActive, set by SetActive, look again when the tab comes on screen once the first look has finished, the way Undo Changes and Recent Changes do. Settings Watchdog's look is the one Refresh runs, so a link from Undo Changes or Recent Changes now shows the change it was sent for, and Restore can act on it. Camera/Mic/Location starts its read off the UI thread as before, and not beside a Refresh still reading, which would have disposed the first read's cancellation source under it. ShownRefresh lets a test await the read.
  • SettingsWatchdogService.ToCsv writes CanWriteBack in "Can restore", and DriftRow.CanRestore, bound by nothing today, is CanWriteBack too, so the row, the CSV and Restore agree.
  • EveryViewModelWithAnIsActiveFlag_IsHandledBySetActive already holds every IsActive flag to a case in SetActive; it fails with either case removed.

Docs

README: Camera/Mic/Location reads again each time it is opened, so "In use now" means now; Settings Watchdog checks each time it is opened; and the CSV's "Can restore" says "no" for a setting that was not set when the baseline was saved.

Tests

  • New in SettingsWatchdogViewModelTests: a setting that drifts after the tab was built is listed when the tab is shown again, with Restore on; leaving the tab reads nothing; and a drift with no value in the baseline is not offered on its row.
  • New in PrivacyMonitorViewModelTests: a camera in use at the first read and let go of since no longer reads "In use now" once the tab is shown again; leaving the tab reads nothing; and showing it while a Refresh is reading starts no second read.
  • New in CsvExportTests: a drift whose baseline value is null writes "no".
  • Red before the fix, green after, each undone on its own: Settings Watchdog not looking when shown; Camera/Mic/Location not reading when shown, reading beside a Refresh, or reading when left; the CSV and the row on CanRestore; and the two SetActive cases removed (the existing guard).
  • Run locally, twice: SettingsWatchdogViewModelTests, PrivacyMonitorViewModelTests, CsvExportTests, SettingsWatchdogServiceTests, SettingsWatchdogViewBindingTests, PrivacyMonitorServiceTests, UndoChangesViewModelTests, RecentChangesViewModelTests, ArchitectureTests and InclusiveTermsTests (519), and the integration FormattedLabelViewUiTests (7). All four projects build with 0 warnings, and dotnet format --verify-no-changes is clean.

…hey are shown, and the drift CSV says what Restore will do

- SettingsWatchdogViewModel and PrivacyMonitorViewModel have an IsActive flag, set by MainWindowViewModel.SetActive,
  that looks again when the tab comes on screen once the first look is done, as Undo Changes and Recent Changes do.
  Camera/Mic/Location does not start a read beside a Refresh still reading. Both tabs read only when built and on
  Refresh, so a link from Undo Changes showed the look from before the change, and "In use now" stayed.
- SettingsWatchdogService.ToCsv writes CanWriteBack in "Can restore", and the drift row's CanRestore is CanWriteBack:
  a setting not set in the baseline is never put back, and every catalog entry has CanRestore.
@laurentiu021
laurentiu021 merged commit aad5128 into main Oct 21, 2026
6 checks passed
@laurentiu021
laurentiu021 deleted the fix/watchdog-and-camera-tabs-read-when-shown branch October 21, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant