You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add an option to quit UniGetUI once automatic updates have finished - #5530
Adds an opt-in setting to quit UniGetUI once automatic updates have finished, and moves the automatic update restrictions next to the switch that controls them.
Quit after automatic updates
New setting QuitAfterAutomaticUpdates, off by default. With it off, every code path behaves exactly as before.
When it is on and an automatic install pass actually launches updates (scheduled install, or an --updateapps launch), UniGetUI waits until it is idle and then quits. Idle means two consecutive 5 s checks where:
no package operation is running or queued,
no maintenance task (local/cloud backup) is running,
UniGetUI's own self-update is not checking or downloading. Waiting for install consent counts as idle, because quitting is what launches a ready installer, same as a manual quit.
It then quits only if:
the main window is hidden in the tray (a user who has the window open is never closed on),
there is no unsaved work. IAsyncLeaveGuard gains a non-interactive HasUnsavedWork probe (dirty catalog editor, open policy editor session), so the automatic quit never opens a discard dialog on a hidden window.
A pass that finds nothing to install does not quit. Otherwise, with the default "after every update check" frequency, the app would exit right after its first check and periodic checks and backups would never run.
Settings layout
The metered / battery / battery-saver restrictions and the new quit toggle moved from Settings → Updates to a new Automatic update restrictions section on Settings → Scheduled maintenance, below the task cards. Before, they were greyed out unless the install task, configured on that other page, was enabled.
They are no longer gated on the install task, because they also govern --updateapps launches, which run with that task off.
Setting keys are unchanged, so existing values carry over.
The cards keep their x:Names, so settings search still scrolls to them (now on the Scheduler page).
The Updates page's scheduler link subtitle now says where the restrictions live.
Testing
dotnet build (x64) clean; dotnet format whitespace and style with --verify-no-changes exit 0.
UniGetUI.Tests: settings search, policy editor, shutdown coordinator and scheduler groups pass (409 tests); UniGetUI.Core.Settings.Tests pass.
Settings layout checked in a dev build. The end-to-end quit after a real automatic update pass from the tray has not been exercised yet.
Not covered
The TUI's auto-install path does not honour the setting. The option is defined by the window being hidden in the tray, which has no TUI equivalent.
The automatic-quit decision has no regression coverage. The new tests cover installer handoffs, while ApplicationShutdownCoordinatorTests covers shutdown authorization rather than this path. Please expose a testable decision helper or inject the activity probes and quit callback, then add deterministic tests for two consecutive idle samples, resetting on activity, and vetoing shutdown when the setting is disabled, the window is visible, or work is unsaved. These checks protect against unexpected exits during work or editing.
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
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.
Adds an opt-in setting to quit UniGetUI once automatic updates have finished, and moves the automatic update restrictions next to the switch that controls them.
Quit after automatic updates
New setting
QuitAfterAutomaticUpdates, off by default. With it off, every code path behaves exactly as before.When it is on and an automatic install pass actually launches updates (scheduled install, or an
--updateappslaunch), UniGetUI waits until it is idle and then quits. Idle means two consecutive 5 s checks where:It then quits only if:
IAsyncLeaveGuardgains a non-interactiveHasUnsavedWorkprobe (dirty catalog editor, open policy editor session), so the automatic quit never opens a discard dialog on a hidden window.A pass that finds nothing to install does not quit. Otherwise, with the default "after every update check" frequency, the app would exit right after its first check and periodic checks and backups would never run.
Settings layout
The metered / battery / battery-saver restrictions and the new quit toggle moved from Settings → Updates to a new Automatic update restrictions section on Settings → Scheduled maintenance, below the task cards. Before, they were greyed out unless the install task, configured on that other page, was enabled.
--updateappslaunches, which run with that task off.x:Names, so settings search still scrolls to them (now on the Scheduler page).Testing
dotnet build(x64) clean;dotnet format whitespaceandstylewith--verify-no-changesexit 0.UniGetUI.Tests: settings search, policy editor, shutdown coordinator and scheduler groups pass (409 tests);UniGetUI.Core.Settings.Testspass.Not covered
Closes #5527