Repository navigation
fix(mod-manager): time the quit teardown on a clock that never stops - #254
Merged
Merged
Conversation
The quit coordinator's teardown limit read the plugin's startup stopwatch, which WriteLastRunReport stops once startup is reported. A deadline read from a stopped clock never passes, so a teardown that never finished would have kept the game open for good instead of letting it quit after 10 s. The coordinator now reads a quit clock that starts with the plugin and is never stopped, and a test fails if a quit timer the plugin makes reads the startup stopwatch again. Signed-off-by: Furroxide <221987073+Furroxide@users.noreply.github.com>
5 tasks done
|
Unity PR artifacts are ready.
Workflow run: Unity Source Validation #657 Artifacts are temporary and expire according to the workflow retention policy. |
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.
Outcome
#234 holds a quit while TopiaForge's teardown runs, for at most 10 s, so that a stuck teardown cannot keep the game
open. In the game that limit never passed.
PluginQuitCoordinatorread its clock from the plugin's startupstopwatch, and
WriteLastRunReportstops that stopwatch once startup is reported. A deadline read from a stoppedclock never arrives, so a teardown that never finished held the quit for good. The game then never exited and had to
be closed by force. That opens the next start in safe mode with every mod off, which is what #234 set out to prevent.
The coordinator now reads a quit clock: a
Stopwatchthe plugin starts once and never stops. Startup timings stillread the startup stopwatch, unchanged.
stuck one was frozen.
PluginQuitCoordinatorTestsdrives the coordinator with a clock of its own, so thedeadline logic was right. The plugin handed it the wrong clock, in a
MonoBehaviourthe test harness cannot run.The new check therefore reads the plugin's source. It checks three things: the quit clock starts with the plugin,
nothing stops or resets it, and the
PluginQuitCoordinatorthe plugin makes reads it and never the startupstopwatch. Any other quit timer the plugin adds can reuse the check (
ReadsTheQuitClock).launcher's request only once, on the first frame.
Deviations from the plan
d404f194), split out so that it can land, and be ported to the release branch, onits own. It applies cleanly onto fix(mod-manager): record the clean exit when the game quits #234 alone. fix(launcher): ask an owned game to quit before restarting it #253 keeps the commit until this merges. Rebasing fix(launcher): ask an owned game to quit before restarting it #253 onto
devthendrops it as already applied.
Compatibility and security
journal format change.
fix(mod-manager): record the clean exit when the game quits #234 intended, and the next start then opens in safe mode, as fix(mod-manager): record the clean exit when the game quits #234 documents for a missed deadline.
Verification
On a Windows 11 x64 machine, on
devat 22d68d1 (the mutations ran on 680d7a9; the one commit between, #251, changes only Dart):dotnet build TopiaForge.slnx -c Release -warnaserror: 0 warnings, 0 errors.dotnet run --project tests\TopiaForge.ModManager.Tests\TopiaForge.ModManager.Tests.csproj -c Release: all pass.The new check is the eleventh in "Plugin quit coordination: 11 behavioral checks passed."
dotnet format TopiaForge.slnx --verify-no-changes, limited to the two edited files: no change.dev;Robotopia 0.0.2545 ran with this fix. There the launcher-quit watcher, which reads the same clock, looked twice a
second as designed, and the game quit within 1 s of the launcher's request.
python -I .github/scripts/check_topiaforge_residue.pyandcheck_readme_counts.py: pass.Checklist
AGENTS.mdand preserved CLEAN/Bloc/Unity/TopiaForge UI boundaries.