Repository navigation
fix: About and Bulk Installer say when a switch that decides whether SysManager goes online could not be saved - #2945
Merged
Conversation
…SysManager goes online could not be saved - UpdateCheckPreferenceService.Save, SetCheckOnStartup and SetCheckAppUpdatesOnStartup, and AppIconService.SetNetworkFetchEnabled return whether the choice was written, as DiskAnalyzerPreferenceService.Save does. They returned nothing, or the flag just set, so a choice that was not kept looked kept, and the next start went online after it had been switched off. - About shows ChangeNotSavedStatus in a line of its own under the two checkboxes, because the tab has no shared status line, and clears it once a choice is saved. Bulk Installer shows it on its status line.
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2833.
Confirmed in the code:
UpdateCheckPreferenceService.SavecaughtIOExceptionandUnauthorizedAccessException, logged at Debug and returned nothing, soSetCheckOnStartupandSetCheckAppUpdatesOnStartupcould not say a save failed;AppIconService.SetNetworkFetchEnabledreturned the flag it had just set. About's two handlers and Bulk Installer'sOnLoadWebIconsChangedignored both. About's view binds noStatusMessage, so the sentence the other tabs use would have been set where nobody reads it.The changes:
Saveand the two setters return whether the file was written, andSetNetworkFetchEnabledreturns whether the choice was saved, the shapeDiskAnalyzerPreferenceService.SaveandWindowsThemeService.SaveScheduleuse.RecordCheckis unchanged: a record that is not kept only means the next start checks again.StartupChecksStatus, shown under the two checkboxes in theSubtleStatusLinestyle and collapsed while empty, like the report and rollback lines on the same card. It saysChangeNotSavedStatuswhen a choice could not be saved and clears once one is.ChangeNotSavedStatuson the status line when the web-icons choice could not be saved.Docs
README: the network notice says About and Bulk Installer tell you when one of these choices cannot be saved. ARCHITECTURE:
UpdateCheckPreferenceServiceandAppIconService.Tests
UpdateCheckPreferenceServiceTests: the switches andSavesay a choice was saved, and say so when a folder where the file goes makes the write fail.AppIconServiceTests: a choice that cannot be saved says so, holds for this run, and the next start does not fetch.SetNetworkFetchEnabled_TogglesAndReportsValueasserted the old return, the flag, and now asserts the flag and the save separately.AboutViewModelUpdateGateTests: a choice that cannot be saved puts the sentence under the switches, and a later one that is saved clears it.BulkInstallerViewModelTests: turning web icons on when the choice cannot be saved says so, and saved choices say nothing. The icon service gets a handler that answers 404, so nothing goes online.AboutViewUiTests(integration): the sentence is on the page, under the switches, once a choice cannot be saved.Saveclaiming a save it did not make, About ignoring the result, the icon switch returning the flag again (which also put the sentence up after a saved "off"), Bulk Installer ignoring the result, and the line removed from the view.AboutViewModelTestsand its three sibling classes,AboutUpdateExitTests,AppIconServiceTests,AtomicFileTests, the three Bulk Installer classes,DashboardViewModelTests,EnvironmentVariablesViewModelTests,NetworkUseGuard,ProfileServiceTests,RowMarkBindingTests,SecurityPromiseTests, both Settings Watchdog classes,UpdateCheckPreferenceServiceTests,WingetFailureTests,ArchitectureTestsandInclusiveTermsTests), and the integration classes that name them. All four projects build with 0 warnings, anddotnet format --verify-no-changesis clean. The new line has not been looked at on screen.