fix(ui): force immediate reboot when user clicks Reboot now - #40
Merged
Conversation
"Reboot now" ran shutdown /r /t 30 without /f, so apps with unsaved state could block the restart and it silently never happened; launch failures were also swallowed by an empty catch. Both buttons now share RebootHelper.ForceRebootNow() which runs shutdown /r /f /t 0 and shows a warning dialog if the reboot cannot be started. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment on lines
+25
to
+32
| catch (Exception ex) | ||
| { | ||
| System.Windows.MessageBox.Show( | ||
| $"Could not start the reboot: {ex.Message}\n\nYou can reboot manually instead.", | ||
| "GamerGuardian", | ||
| System.Windows.MessageBoxButton.OK, | ||
| System.Windows.MessageBoxImage.Warning); | ||
| } |
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.
Clicking "Reboot now" — from the auto-apply toast or the Apply results window — could silently never reboot: it ran
shutdown /r /t 30without an explicit force flag, so any app with unsaved state could hold Windows at the "these apps are preventing restart" screen, and launch failures were swallowed by an emptycatch. Both buttons now call a sharedRebootHelper.ForceRebootNow()that runsshutdown /r /f /t 0— an immediate restart that force-closes open applications without prompting to save. If the reboot can't be started, a warning dialog now shows the actual error instead of failing silently. Verified withdotnet build(0 warnings, warnings-as-errors) and the full xUnit suite (387 passed).