0.9.11: faster switches, ask before closing during a snapshot, one app identity, CI runs every script test #141

Merged
ethan-hann merged 33 commits from integration-0911 into main 2026-10-25 15:00:56 -05:00
Owner
  • A switch writes the index entries of left-out files whose size differs from the target's straight from the plan (update-index --index-info) instead of resetting them, so it reads none of them: a switch with a 2 GB left-out cache went from 12.8 s to 0.71 s. Same-size files still go through reset to keep their stamp. Closes #137.
  • Closing SavePoint while a snapshot is being taken asks first: Minimize (the default; the snapshot finishes and a notification says when), Close and stop the snapshot, or Stay open. A minimized window is restored before any close question. A system shutdown never waits on it.
  • On Linux the app identifies as SavePoint (window class, AppImage desktop entry and package name), so GNOME names notifications SavePoint. Closes #132.
  • CI: the Linux gate installs PowerShell, gpg and dbus, and the Windows gate puts Git's gpg on PATH, so 94 expected skips are gone and every build-script, signature, wiki and notification test runs on both gates. The signature check works with Git for Windows' gpg as well as Gpg4win.

The Windows pack id change (one SavePoint id for all platforms, with SavePoint's data moved out of the folder the setup owns) joins this PR before it merges, with the version bump.

- A switch writes the index entries of left-out files whose size differs from the target's straight from the plan (update-index --index-info) instead of resetting them, so it reads none of them: a switch with a 2 GB left-out cache went from 12.8 s to 0.71 s. Same-size files still go through reset to keep their stamp. Closes #137. - Closing SavePoint while a snapshot is being taken asks first: Minimize (the default; the snapshot finishes and a notification says when), Close and stop the snapshot, or Stay open. A minimized window is restored before any close question. A system shutdown never waits on it. - On Linux the app identifies as SavePoint (window class, AppImage desktop entry and package name), so GNOME names notifications SavePoint. Closes #132. - CI: the Linux gate installs PowerShell, gpg and dbus, and the Windows gate puts Git's gpg on PATH, so 94 expected skips are gone and every build-script, signature, wiki and notification test runs on both gates. The signature check works with Git for Windows' gpg as well as Gpg4win. The Windows pack id change (one SavePoint id for all platforms, with SavePoint's data moved out of the folder the setup owns) joins this PR before it merges, with the version bump.
A switch aligned the index for the files the patterns name with reset <tree> -- <paths>, which reads every differing file (about 14 s warm for a 2 GB left-out cache with the bundled git 2.56). The entries are now written with update-index --index-info from the plan's mode and id; named paths the target lacks get mode 0 lines, written first. A file whose size equals the target blob's size (or a symlink or gitlink) still goes through reset, after the removals and before the index-info additions, so a file that already holds the target's bytes keeps a valid stamp and the reset's whole-index refresh never meets an unstamped entry. The displaced-entry check, the skip-worktree marks and the saved original index are unchanged. TreeChange now carries the new mode.

Observed reds: LeftOutReadOnceTests.A_left_out_file_of_another_size_than_the_target_is_aligned_without_a_reset (both force values): Assert.DoesNotContain failure, a reset ran. GitOutputParsingTests.Tree_changes_pair_each_record_with_its_path: NewMode was empty, expected 000000/100644. Tests that hooked the reset call to fail or interfere with the alignment (IndexAlignmentTests x3, SwitchSafetyTests x1) went red because no reset runs any more; they now hook EngineWorkspace.IsIndexAlignment.

Mutation checks: dropping the removals fails A_left_out_file_the_target_lacks_leaves_the_index_and_stays_on_disk; sending every file through index-info fails A_left_out_file_that_already_holds_the_targets_bytes_keeps_a_valid_stamp_in_the_index; mangling the path in the index-info line fails A_left_out_file_with_spaces_and_accents_in_its_name_is_aligned; dropping the reset fails the same-size tests. Putting the additions before the removals is not caught: git removes by exact spelling, so the order cannot take the new entry out.
GNOME titled notifications 'SavePointApp' because the window class and the AppImage's StartupWMClass followed the Velopack pack id. The Linux pack id and the window class are now SavePoint. The Windows setup keeps SavePointApp (new SavepointWindowsPackId) because its install folder is %LOCALAPPDATA%\<pack id>, which is where SavePoint keeps its data (D38); a test pins that the two never meet.

Observed reds: DesktopIdentityTests.The_window_class_is_the_name_people_know_the_app_by (Expected SavePoint, Actual SavePointApp); AppsMenuEntryTests.Adding_writes_a_desktop_entry_with_exactly_these_fields (Expected StartupWMClass=SavePoint, Actual StartupWMClass=SavePointApp); PackageLocationTests.The_pack_id_the_Linux_AppImage_carries_is_the_app_name (Expected SavePoint, Actual SavePointApp); PackageLocationTests.Each_package_script_takes_its_pack_id_from_the_build_properties (package.ps1 lacks SavepointWindowsPackId).
Mutation: setting the Windows pack id to SavePoint fails The_Windows_pack_id_is_not_the_name_of_SavePoints_data_folders and Nothing_SavePoint_keeps_lives_in_the_folder_the_installer_removes_on_uninstall.
The Linux gate job ran in a container with no PowerShell, gpg or message bus daemon, so the tests that drive the build/ PowerShell scripts, the real-gpg signature test and the private D-Bus notification tests all skipped there and were listed as expected skips.

The job now installs PowerShell as a .NET tool (as the release job does) and opens /opt/pwsh and /opt/dotnet to the ordinary gate user, whose PATH and DOTNET_ROOT carry them. It installs dbus and gnupg with apt. The 80 skip lines those tests had in linux-ci.txt are removed, and the stale Windows lines for ReleaseWorkflowTests and WikiSyncTests go too (pwsh is always there). build/gate-linux.sh installs the same pwsh tool into .tools for the local WSL gate.

Observed red (GateWorkflowTests, before the workflow and lists changed):
- The_linux_job_installs_pwsh_as_a_tool_after_the_sdk_and_before_the_gate: "The Linux job has no step named Install PowerShell."
- The_gate_user_can_read_and_start_pwsh: same assertion message.
- The_linux_job_installs_gpg_and_a_message_bus_daemon_before_the_gate: "The Linux job has no step named Install the tools the tests drive."
- The_linux_list_of_expected_skips_does_not_name_tests_the_job_can_run for Msys2SourcesScriptTests (43), PackageSourceScriptTests (13), ReleaseWorkflowTests (14), WikiSyncTests (7), DBusNotificationBusTests (4): "linux-ci.txt still names N test(s) of ...".
Closing used to cancel a running snapshot and wait about 3 seconds with no
question, losing the snapshot silently. Now a running Capture job makes the
exit guard show a dialog first: Minimize (default) minimizes the window and
leaves the job running, "Close and stop the snapshot" cancels it and closes,
and Stay open / Esc / scrim return to the app. The copy says minimizing lets
the snapshot finish and SavePoint tells the player when it is done.

Other cancellable jobs are unchanged (a free-up before its point of no return,
a launch before it switches folders): stopping them loses nothing. A system
shutdown still never waits on the dialog. HostIntegration gets an internal
Attach overload taking the notification service so a test can prove the
finished-while-minimized notification.

Observed reds (ExitGuardTests): A_snapshot_being_taken_asks_before_anything_is_cancelled,
Staying_open_..., Dismissing_the_question_with_escape_stays_open,
Minimizing_keeps_the_window_open_... failed Assert.False (guard returned true, no
question); Closing_and_stopping_... and A_snapshot_and_a_storage_move_each_get_their_own_question
failed Assert.Single (no dialog shown). MainWindowTests
Closing_while_a_snapshot_is_taken_asks_before_anything_is_stopped failed Assert.Single
(empty); the minimize, stop and escape window tests timed out waiting for the
dialog and failed on the missing dialog.

Mutation checks for tests that passed first run: NotificationPolicy ignoring
IsMinimized fails the minimized-notification test; dropping the OSShutdown
clause in MainWindow.OnClosing fails both system-shutdown tests; Minimize
answering Stay and removing IsDefault from the Minimize button fail the dialog
tests.
A close question on a minimized window (closing from the taskbar) went unseen.
The exit guard now raises an event just before each of its dialogs, and the
main window restores itself if minimized. Choosing Minimize in the snapshot
question minimizes it again; a minimized window with nothing running still
closes without being restored.

Observed red: A_question_asked_while_the_window_is_minimized_restores_it_and_minimizing_again_puts_it_back
failed Assert.Equal (state while asking was Minimized, expected Normal).
Mutation: raising the event at the start of PrepareToCloseAsync fails
A_minimized_window_with_nothing_running_closes_without_being_restored.
The removals go in before the reset to keep the index it refreshes small; the comment gave a reason that does not hold, since git removes by exact spelling, and the case-rename test is renamed for what it checks (one entry with the target's id). update-index --index-info on Windows prints 'Ignoring path <name>' and exits 0 for a name the system cannot hold, so that line now fails the alignment (the old reset failed). In practice such a name never reaches it, because the named paths come from an index that drops it the same way; the switch is then refused by git checkout with the name, which the new Windows-only test checks.

New tests, all first-run passes: a same-size and a different-size file in one switch (the reset's pathspec holds only the same-size path, removals first, additions last); a failure writing the additions after the reset (the original index comes back, no note). Mutations: sending every named path to the reset fails the first; running the reset against the real index fails the second. The 'Ignoring path' check has no test: it cannot be reached through a tree, as described.
The gpg that ships with Git for Windows is an msys program. It refuses a Windows-style --homedir (its agent socket name cannot hold the colon of a drive letter) and its socket path must stay under about 100 characters. build/msys2-sources.ps1 now has ConvertTo-GpgHome, which gives that gpg /c/Users/... and any other gpg the path unchanged, and New-GpgHome, which moves the private home under the machine-wide data folder when the temp folder is too deep for a socket path. New-SignatureVerifier and the real-gpg test use both. The Windows gate job appends Git's usr\bin to the end of PATH before the gate, so the test runs on the runner, and its skip line is removed from windows.txt.

build/gate-linux.sh now stops with the apt command to run when the distro lacks dbus or gnupg, instead of letting those tests skip against the skip list.

Observed red:
- A_gpg_home_is_given_to_the_gpg_of_git_for_windows_in_its_own_form_and_to_any_other_as_it_is (with a stub that returned the path unchanged): Expected "/c/Users/x y/Temp/abc\n/c/Users/x y/Temp/abc\n..." Actual "C:\\Users\\x y\\Temp\\abc\nC:\\Users\\x y\\Temp\\abc\n...".
- The_real_gpg_... run with Git's gpg first on PATH: failed ("You cannot call a method on a null-valued expression" after gpg could not start its agent).
- The_windows_gate_finds_the_gpg_of_git_for_windows_after_everything_else_on_the_path: "The Windows gate step does not append Git's usr\bin to the path."
Merge branch 'issue-132-app-identity' into integration-0911
Some checks failed
Gate / linux (pull_request) Failing after 11m41s
Gate / windows (pull_request) Failing after 30m38s
b3afdb5d24
Velopack's Windows setup owns %LOCALAPPDATA%\<pack id>: install renames it aside
and starts empty, uninstall clears it. With the pack id SavePoint on both
platforms, the default storage, logs and runtime folders move to
%LOCALAPPDATA%\SavePoint Data. The catalog stays in %APPDATA%\SavePoint, which
the setup never touches.

AppDirectories gains LegacyLocalDir (Windows only). At the start of the
startup check, a storage folder left in the old place is renamed to the new
default when the settings name it or name nothing and the new default is not
there; a folder the player chose is never moved. If the rename fails with no
saved folder, the old folder is saved as the root so the first run does not hide
it. Old log files move across, never over a file already there.

package.ps1 reads SavepointPackId (SavepointWindowsPackId is gone) and no
longer renames the downloads, since vpk already names them SavePoint-*.

Observed reds before the change:
- PackageLocationTests.Nothing_SavePoint_keeps_lives_in_the_folder_the_installer_removes_on_uninstall:
  "...\Local\SavePoint\Storage is inside ...\Local\SavePoint\, which uninstalling SavePoint deletes"
- PackageLocationTests.Each_package_script_takes_its_pack_id_from_the_build_properties(package.ps1):
  Assert.Contains() Failure: Not found: "SavepointPackId"
- PackageLocationTests.One_pack_id_serves_both_platforms_and_is_the_app_name:
  Assert.Empty() Failure: Collection was not empty [SavepointWindowsPackId]
- AppDirectoriesTests.Windows_keeps_the_catalog_in_roaming_...: Expected SavePoint Data\Storage, Actual SavePoint\Storage
- LegacyLocalDataTests: moves history (Expected data\Storage, Actual legacy\Storage), no saved folder,
  failed move keeps old folder (Expected legacy\Storage, Actual data\Storage), old logs did not arrive.

Mutation checks: dropping the settings guard fails the chosen-folder test;
dropping the empty-folder guard fails the empty-folder test.
Storage moved into %LOCALAPPDATA%\<pack id> goes when SavePoint is installed
or removed, whether or not the app runs from there. The destination rules now
refuse that folder and anything inside it (a sibling such as "SavePoint Data"
is allowed), with the existing install-folder message.

When the one-time move of old storage fails and the data stays in that folder,
the storage status and the storage summary say so. A warning toast tells the
player once the shell is up, and the Settings storage section shows a note
beside the folder until it is moved.

Observed reds before the change:
- RelocationInstallerFolderTests (SavePoint, SavePoint/Storage, SavePoint/current/data):
  Assert.Equal() Failure, expected error.storageRelocation.insideInstallFolder.
- StorageSectionViewModelTests.A_folder_the_installer_clears_is_flagged...: Assert.True() Failure, expected True, actual False.
- MainWindowViewModelTests.Storage_the_installer_clears_gets_a_warning_toast...: Assert.Single() Failure, the collection was empty.

Mutation checks: forcing the flag false in the startup status, then in the
summary, fails the failed-move test; hiding the note in the view fails the
view test.
Every released Windows build was packed as SavePointApp and keeps its data in
%LOCALAPPDATA%\SavePoint. A setup packed as SavePoint renames and empties that
folder before the app runs, so the move out of it could never happen. The
Windows pack id therefore stays SavePointApp for now: SavepointWindowsPackId is
back (temporary), package.ps1 reads it and renames the downloads again, Linux
keeps SavePoint. PackageLocationTests pins that no data folder lies inside
either id's folder and that the Windows id is not SavePoint yet. Storage
destinations inside %LOCALAPPDATA%\SavePointApp are refused as well
(AppDirectories.InstallerLocalDir).

The one-time move now also:
- saves the new default as the root when the settings name a missing old
  folder and the new default holds the history (a crash between the rename and
  the settings write);
- with no saved folder, moves onto an existing but empty new default, and when
  the new default holds files of its own keeps the old history in use and
  flagged instead of hiding it;
- moves the storage back after a failed settings write whatever the failure was;
- is checked through the history API after the move.

Also restores the space lost in "settings.storage.used".

Observed reds before the change:
- LegacyLocalDataTests.With_no_saved_folder_an_empty_new_default_does_not_hide_the_old_history: history did not arrive.
- LegacyLocalDataTests.With_no_saved_folder_a_new_default_that_cannot_take_the_move_...: Expected ...\legacy\Storage, Actual ...\data\Storage.
- LegacyLocalDataTests.Settings_naming_a_missing_old_folder_follow_...: failed with the half-moved storage (after fixing a missing parent folder in the test setup; red re-observed by disabling the branch).
- PackageLocationTests.The_Windows_pack_id_is_not_the_folder_old_data_is_moved_out_of_...: Windows id set to SavePoint, assertion failed.
- PackageLocationTests.The_platform_names_the_installer_folder_after_the_Windows_pack_id: Assert.Equal() Failure, no installer folder.

Mutation checks: disabling the half-moved branch fails its test; removing the
move back fails the settings-write test; dropping InstallerLocalDir from the
refusal fails the SavePointApp rows.
Only Windows refuses a file name with a colon, so the test added with the read-once alignment skips in the Linux container. The skip list was regenerated before that test landed.
When the started program exited after the watcher's last check but before it
chose how to wait, the wait saw an already-finished exit task and slept the
full polling interval instead of waking at once. On a busy machine a test on
a manual clock never advanced that timer, so ExitChildAsync timed out in
A_list_that_was_readable_at_any_look_during_the_grace_counts_as_a_name_that_never_appeared.
A real session lost up to one polling interval before noticing the exit.

The wait now always races the delay against the exit task while the program
is still believed alive, and the loop passes no exit task once it has seen
the exit, so a finished task cannot busy-loop.

Observed red: A_program_that_exits_just_after_the_wait_is_armed_is_noticed_
without_the_clock_moving failed with Assert.Same() Failure (the 5 second
guard task won; the process list was never read a second time). A hook on a
wrapped manual clock exits the child right after the wait's timer is created,
which lands the exit in the race window deterministically. The red is the
mutation check: with the fix reverted the test fails, with it the class
passes (53 of 53).
The one-time move of the old default storage could still end with history
in %LOCALAPPDATA%\SavePoint, which the next setup empties, or hidden behind
a new default. Now:
- a settings write whose read-back failed no longer sends the folder back:
  the settings are read again (three tries) and the folder returns only while
  they still name the old folder or none; if they cannot be read, nothing moves
  and the next start finishes it;
- settings naming a new default that holds nothing, with the history still in
  the old folder, finish the move (or save the old folder if it cannot move);
- with no saved folder, when saving the old folder as the root also fails, the
  check ends at the storage screen instead of letting the first run take a new
  default that would hide the history;
- with no saved folder and history in both folders, the old folder becomes the
  root and the warnings apply; both of these cases and the one where settings
  name the old folder and the new default has files are logged as warnings;
- only I/O, access, SavePoint and JSON failures count as a failed write; any
  other failure still moves the folder back and then fails the check;
- a failed move back says the next start finishes the move.
Also rewords the InstallerLocalDir comment, which stops being true once the
pack id switches.

Observed reds before the change (assertion failures):
- Settings_naming_a_new_default_that_holds_nothing_finish_the_move... (both rows): storage reported lost.
- With_no_saved_folder_history_in_both_folders_keeps_the_old_one...: Expected ...\legacy\Storage, Actual ...\data\Storage.
- An_unexpected_failure_of_the_settings_write_puts_the_storage_back_and_fails_the_check: Assert.False() Failure, check had succeeded.
- A_new_default_folder_that_already_exists_is_left_alone...: no warning logged.
- The read-back and storage-screen tests passed or failed for the wrong reason until the
  hook was wired through the check; their reds were then observed by mutation.

Mutation checks: skipping the settings read before the move back fails the
read-back test; making the old-folder save always succeed fails the storage
screen test.
Version 0.9.11
Some checks failed
Gate / windows (pull_request) Has been cancelled
Gate / linux (pull_request) Has been cancelled
6d989064f6
Stopping at the storage screen was a dead end: with no saved folder "Find the
folder" and "Start with an empty folder" are both refused there, and the old
folder is refused as a destination. When history cannot be made the saved
root, the folder holding it is now used for this run only (StorageHost
override, nothing written), so the history is listable, the installer-folder
warning and Settings note fire, and the next start tries the save again. The
Settings screen names that folder while it is in use.

Also:
- settings naming an empty old folder while the history sits in the new
  default use the new default for this run when the write that fixes it fails;
- a folder holding only the empty-start note counts as empty in the move;
- a cancelled or broken read-back after a failed write no longer replaces the
  original failure; the folder stays in the new default and the next start
  finishes the move;
- a failed move back shows the new default for this run.

Observed reds before the change (assertion failures):
- With_no_saved_folder_a_settings_file_that_cannot_be_written_uses_the_old_history_for_this_run_flagged: Assert.True() Failure, Expected True, Actual False (storage reported unreachable).
- Settings_that_cannot_follow_a_finished_move_show_the_new_default_for_this_run: Expected ...\data\Storage, Actual ...\legacy\Storage.
- A_failed_move_back_shows_the_history_this_run...: Expected ...\data\Storage, Actual ...\legacy\Storage.
- A_cancelled_read_back_...original_failure_surfaces: Assert.NotEqual() Failure, error.operation.cancelled replaced it.
- A_new_default_holding_only_the_empty_start_marker_is_moved_onto and An_old_folder_holding_only_the_empty_start_marker_moves_nothing: Assert.False() Failure.

Mutation check: disabling the recovery that saves a new default holding the
history fails the next-start, failed-move-back and half-move tests.
Merge branch 'windows-pack-id-savepoint' into integration-0911
Some checks failed
Gate / linux (pull_request) Failing after 11m25s
Gate / windows (pull_request) Successful in 33m49s
ba86d88e43
Expect the two Windows-only storage move tests to skip on Linux
Some checks failed
Gate / windows (pull_request) Failing after 38s
Gate / linux (pull_request) Failing after 44s
7a057fb7dc
Only Windows refuses to rename a folder that holds an open file or to replace a file another program holds open, which is how these tests make the move and the settings write fail.
Install the .NET SDK through one script that survives a half-published release
All checks were successful
Gate / linux (pull_request) Successful in 13m11s
Gate / windows (pull_request) Successful in 33m37s
Wiki / publish (push) Successful in 1m24s
Release / linux (push) Successful in 2m41s
Gate / linux (push) Successful in 14m5s
Gate / windows (push) Successful in 34m40s
Release / windows (push) Successful in 2m24s
Release / checksums (push) Successful in 34s
1712815970
Microsoft's 10.0 channel link named SDK 10.0.403 before its files were downloadable: the origin answered 409 and both gate jobs failed before building. build/install-dotnet.sh and .ps1 try the channel first and, when that fails, install the SDK the release feed lists as latest. Every workflow uses them now instead of its own copy of the install lines.

Tried by hand with a channel that does not exist: both scripts fell back and installed 10.0.402 (the shell one on WSL, where a grep that stopped at its match first broke curl's pipe; the feed is saved to a file now).
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ethan-hann/SavePoint!141
No description provided.