Refuse a snapshot that would fill the drive, and clear its leftovers before the space check #164

Closed
opened 2026-10-25 23:36:47 -05:00 by ethan-hann · 1 comment
Owner

Found by a resilience review (report kept by the maintainer). GitEngine.Capture.cs:83-85 runs EnsureStorageSpace (100 MiB floor, no extraBytes, GitEngine.cs:103) before BeginWrite, whose cleanup removes leftover tmp_pack files (GitEngine.cs:135-138). A first snapshot of a 90 GB install with 60 GB free fills the drive (if storage is on C:, the game cannot write saves), and the multi-GB leftover makes every retry fail the space check until restart. Fix: run the cleanup first; estimate the new and changed bytes and pass them as extraBytes so the snapshot refuses before writing. Also, LaunchOrchestrator.Start.cs:264-273 switches the install before knowing the saves folder can switch (space, case clashes, links are checked per folder in CheckoutAsync); add a read-only check of both folders first, so a refused second folder never leaves install and saves on different profiles.

Found by a resilience review (report kept by the maintainer). GitEngine.Capture.cs:83-85 runs EnsureStorageSpace (100 MiB floor, no extraBytes, GitEngine.cs:103) before BeginWrite, whose cleanup removes leftover tmp_pack files (GitEngine.cs:135-138). A first snapshot of a 90 GB install with 60 GB free fills the drive (if storage is on C:, the game cannot write saves), and the multi-GB leftover makes every retry fail the space check until restart. Fix: run the cleanup first; estimate the new and changed bytes and pass them as extraBytes so the snapshot refuses before writing. Also, LaunchOrchestrator.Start.cs:264-273 switches the install before knowing the saves folder can switch (space, case clashes, links are checked per folder in CheckoutAsync); add a read-only check of both folders first, so a refused second folder never leaves install and saves on different profiles.
ethan-hann added this to the 1.0 milestone 2026-10-25 23:36:47 -05:00
Author
Owner

Shipped in 0.9.15 (pull request 174).

Shipped in 0.9.15 (pull request 174).
Sign in to join this conversation.
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#164
No description provided.