0.9.15: a calmer editor, templates after the first game, clearer buttons, and safety fixes from the reviews #174
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ethan-hann/SavePoint!174
Loading…
Reference in a new issue
No description provided.
Delete branch "integration-0915"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #156, #157, #158, #162, #163, #164, #165 and #166.
A UX review, a security review and a resilience review (han review agents) found the issues this release fixes.
UI: the game editor shows each warning only where it applies and keeps the optional fields under More settings, with explanations behind question buttons (#156). Add a game searches the built-in templates as the player types, offers Pick from the game list, and template notes now come from the catalog; the blanket Steam Cloud sentence left all 249 notes (#157). History says Go back and play / Go back without playing, a profile that is not loaded says Switch and play, Take a snapshot sits by the tabs, and profile notes show (#158).
Core: a game folder is pinned and rechecked right before every step that deletes or replaces files, and held open on Windows, so a folder swapped in between is refused (#162, D57). Git writes are flushed (core.fsync, file by file on every system) and a damaged index is rebuilt beside the real one from the last snapshot by the game-lock holder (#163, D58). A snapshot counts the size it will add before writing, temp packs left by a stopped snapshot no longer block the next, and a launch checks the saves folder before switching the install (#164). Gits are tied to the app with a Windows job object and recorded in a per-user note, so the next start ends leftovers before cleaning locks (#165, D59). An unreadable switch note fails closed with a way out (#166).
Every issue was implemented test-first, reviewed by a separate reviewer and fixed; the reds are in the commit messages. The full Windows gate passed locally (15,918 tests); the WSL Linux gate passed apart from 9p retries and one test that looked for packages in the wrong folder, fixed in
b64fd36. Follow-ups are filed as #167 to #173.A power cut seconds after a snapshot or switch could leave git's index file empty or short. With the bundled git 2.56 every command then fails ("index file smaller than expected", "index file corrupt") and nothing in SavePoint repaired it. - The managed repo config sets core.fsync=committed,index and core.fsyncMethod=batch (config stamp 7), so existing repositories take them the next time they are touched. - GitFailure.IsIndexDamage recognizes the four index messages. - The engine sets a damaged index aside as index.damaged-<time>, rebuilds it with read-tree HEAD (no game file is touched), and runs the failed call once more. An unborn branch just starts with an empty index. An emptied ref file is not taken for an unborn branch. When the latest snapshot cannot be read, the file is put back and RepositoryDamagedException (error.gitOperation.recordDamaged) is thrown, with plain-words copy and an error card entry. A second failure right after a repair throws the same error. Repairs are serialized and logged. Timing (5,000 files x 40 KB = 200 MB, add + commit, managed settings, bundled git 2.56 on NVMe, F: drive, 3 runs each, ms): none 14.7 s mean (13559 / 15223 / 15385; rerun 16502 / 14398 / 14116) batch 10.1 s mean (12293 / 9027 / 8950; rerun 10341 / 9062 / 10198) fsync 15.6 s mean (14962 / 13923 / 18018) [fsyncMethod=fsync] batch+ref 11.9 s mean (15688 / 9228 / 10876) [adds "reference"] Batch is faster than no setting here, so there is no cost to report. No warning is printed about the method on Windows. Observed reds (assertion failures, before the change): - RepoConfigTests.Init_applies_the_setting_and_git_reads_it_back(core.fsync): Expected "committed,index", Actual null; same for core.fsyncmethod "batch". - RepoConfigTests.A_repository_stamped_6_takes_the_flush_settings_the_next_ time_it_is_touched: Expected "committed,index", Actual null. - RepoConfigTests.Init_again_reapplies_the_settings_when_the_stamp_differs: Expected "7", Actual "6". - IndexRepairTests.A_snapshot_after_the_index_was_damaged_is_taken_... (empty, zero-filled, truncated), The_damaged_index_is_kept_under_a_new_name..., A_switch_after_the_index_was_damaged_goes_through, A_first_snapshot_that_ was_cut_off...: Assert.Null failure, Actual GitOperationException "git ls-files -z -t exited with code 128: fatal: ...index: index file smaller than expected" (or "bad signature 0x00000000"). - IndexRepairTests unrepairable cases: Assert.IsType failure, Expected RepositoryDamagedException, Actual GitOperationException. - ErrorCopyTests.Every_error_key_in_the_catalog_has_a_sample_error: 'error.gitOperation.recordDamaged' has no sample error. Mutation checks on tests that passed first run: IsIndexDamage widened or with phrases dropped fails IndexDamageClassificationTests; put-back of the set-aside file disabled fails the two "nothing is changed" tests; unborn detection flipped fails 5 repair tests. Tests run one class at a time with --max-threads 2: IndexRepairTests (14), IndexDamageClassificationTests (14), RepoConfigTests (73), CaptureTests (56), CheckoutTests (22), InitTests (16), StaleLockTests (10), DeleteRepoTests (26), MaintenanceTests (11), StorageUnreachableChoicesTests (22), ErrorTypesTests (63), and in the App tests ErrorCardViewModelTests, CatalogLintTests, CatalogCopyRuleTests, LocalizationCatalogTests and ErrorCopyTests. dotnet format and the warnings-as-errors build are clean.The leftover check matched programs by the bundled git's folder. That fails under an AppImage (a new mount path each launch) and macOS translocation, reaches other users' programs on one machine, trusts parent ids that are reused, and ended a process without checking its start time again. Now the registry keeps a small note in the user's runtime folder of the gits this run started that are still going: the owner's and each git's id and start time. It is written from a timer 500 ms after the set changed and only when it differs from what was written last, so short calls cost no writes (a SavePoint stopped from outside within 500 ms of starting a git leaves no note of it; a git that short is over by the next start). The next start reads the note when the backend is built, ignores a note whose owner still runs, waits a bounded time for the gits it names that still match by id and start time (one clock, Process.StartTime), then ends them after checking the start time again on the process just opened. No path matching and no parent walk remain. Reclaim gits (D46.1) are left to finish: they are kept out of the Windows job object and out of the note, and the start still waits for them through their own note, before the leftover check and before the lock cleanup. Every other git stays in the job. A leftover that cannot be ended is kept (carried into the new note) and a check of it is handed to the engine: while it runs no lock or temporary file is removed before a write or at startup, and a reclaim or a clear of removed records is refused. The cut-off free-up finish is skipped and logged only when a free-up note exists. The startup screen says "SavePoint is waiting for a task it started before it closed" while it waits for a leftover (new progress value and catalog line). The job log line is skipped for a process that had already ended. Observed reds (assertion failures, before the code existed): - RunningGitNoteTests.What_is_written_is_read_back: Assert.NotNull() Failure: value does not have a value - GitProcessRegistryNoteTests: A_git_that_keeps_running_is_written_to_the_note_with_this_program_as_its_owner "the note was never written"; The_note_goes_when_the_last_git_ends; A_git_carried_over_from_an_earlier_run_... "a carried git was not written"; Closing_ends_what_runs_and_removes_the_note Assert.True() Failure - LeftoverGitsTests: A_git_the_note_names_is_ended_... "the leftover is still running"; Ending_a_process_checks_its_start_time_at_that_moment Assert.True() Failure; A_leftover_that_cannot_be_ended_... "a process that was not ended was reported as gone"; The_screen_is_told_before_the_wait_begins; A_leftover_that_ends_by_itself_... Assert.False() Failure - LeftoverGitGuardTests: all four ("a lock was removed under a git that is still running"; RemoveStaleLocks Expected: 0 Actual: 1; reclaim and ClearExactAsync "No exception was thrown") - GitProcessJobTests.A_process_that_had_already_ended_is_not_worth_a_line_in_the_log: Assert.Empty() Failure: the access-denied warning was logged - StartupLeftoverGitTests: A_git_the_note_of_a_stopped_SavePoint_names_is_ended_... "the leftover git is still running"; Locks_and_temporary_files_stay_... "a lock was removed under a git that is still running"; The_screen_is_told_a_task_... Expected [WaitingForEarlierTask] Actual []; A_clear_that_was_cut_off_is_not_finished_... "a clear was finished under a git that is still running"; A_git_the_backend_runs_is_written_to_the_note_... "the running git was never written to the note" - StartupViewModelTests.While_a_task_started_before_SavePoint_closed_...: Expected (Checking, True, False) Actual (Checking, False, False); StartupViewTests.While_a_task_started_...: Assert.Contains() Failure: item not found Mutation checks of tests that passed on their first run (each mutation failed the named test and was restored): Clear as a no-op fails Clearing_removes_the_note_...; reading a bad note without catching fails A_missing_or_unreadable_note_...; writing an empty set or ignoring the persist flag fails A_git_that_ends_within_the_delay_is_never_written and A_git_that_is_left_to_finish_is_not_written; dropping the owner check fails A_note_whose_owner_still_runs_...; not filtering stamps by start time fails A_process_that_only_has_the_number_...; logging when nothing is left fails Nothing_is_said_...; putting every git in the job fails A_git_that_is_left_to_finish_is_not_put_in_the_job_...; running the leftover check before the reclaim wait fails The_start_waits_for_a_noted_reclaim_first_...