Save sharing: a zip's Saves and Storage import in any letters #584

Open
github-bot wants to merge 1 commit from github-bot/gh-584 into main AGit
Owner

@⁠kibagami-nc on GitHub · 2026-11-28 01:19 UTC · original
kibagami-nc:fix/save-import-part-names-any-case → main · +33 −2 · 1 files · 1 commits · open

The problem

place (crates/victory-gpu/src/save_share.rs) finds a save's parts in a zip whatever their case (p.eq_ignore_ascii_case(k)), but it kept the zip's own spelling in the path it gave back. unzip then checks for the import's saves part by its exact name: Path::starts_with compares components as they are written.

So a zip whose folder is Saves (or SAVES) was refused with "no save in that zip (no saves folder)". A player who renames or zips the folders by hand gets this, as does any zip tool that changes case.

The change

place gives the part as PARTS names it (saves, storage), followed by the rest of the entry's path. The import then lands in the folders as the game names them.

Tests

  • New save_share::tests::a_zip_with_its_parts_named_in_capitals_imports: a zip of my save/Saves/... and my save/STORAGE/....
    • The check. It stages, it is applied, both parts' files are in place, and the folders are named saves and storage.
    • Before / after. It fails before the change with NotFound: "no save in that zip (no saves folder)", and passes after it.
  • The other five save_share tests pass.
  • cargo test -p victory-gpu --locked --lib: 442 passed. The 2 failures are the indirect tests that fail on main too, fixed in #578.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: nothing in save_share.rs. It still stops on the dead-code lints main has.

No game files, dumps or extracted data are included.

**@⁠kibagami-nc** on GitHub · 2026-11-28 01:19 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/584) `kibagami-nc:fix/save-import-part-names-any-case` → `main` · +33 −2 · 1 files · 1 commits · open ## The problem `place` (`crates/victory-gpu/src/save_share.rs`) finds a save's parts in a zip whatever their case (`p.eq_ignore_ascii_case(k)`), but it kept the zip's own spelling in the path it gave back. `unzip` then checks for the import's `saves` part by its exact name: `Path::starts_with` compares components as they are written. So a zip whose folder is `Saves` (or `SAVES`) was refused with "no save in that zip (no saves folder)". A player who renames or zips the folders by hand gets this, as does any zip tool that changes case. ## The change `place` gives the part as `PARTS` names it (`saves`, `storage`), followed by the rest of the entry's path. The import then lands in the folders as the game names them. ## Tests - New `save_share::tests::a_zip_with_its_parts_named_in_capitals_imports`: a zip of `my save/Saves/...` and `my save/STORAGE/...`. - **The check.** It stages, it is applied, both parts' files are in place, and the folders are named `saves` and `storage`. - **Before / after.** It fails before the change with `NotFound: "no save in that zip (no saves folder)"`, and passes after it. - The other five `save_share` tests pass. - `cargo test -p victory-gpu --locked --lib`: 442 passed. The 2 failures are the indirect tests that fail on `main` too, fixed in #578. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: nothing in `save_share.rs`. It still stops on the dead-code lints `main` has. No game files, dumps or extracted data are included.
place() finds a save's parts in a zip without regard to case (Saves,
STORAGE), but kept the zip's own spelling, and unzip then looked for the
import's saves part by its exact name (Path::starts_with("saves")). A zip
whose folder is "Saves" was refused: "no save in that zip (no saves
folder)".

The part is now given as PARTS names it, so the import lands in saves and
storage as the game names them.

Test: a_zip_with_its_parts_named_in_capitals_imports (my save/Saves/...,
my save/STORAGE/...). It fails before the change with that error.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 01:24:13 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/584/head:github-bot/gh-584'
git switch 'github-bot/gh-584'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-584'
git switch 'github-bot/gh-584'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-584'
git switch 'github-bot/gh-584'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-584'
git switch 'main'
git merge --squash 'github-bot/gh-584'
git switch 'main'
git merge --ff-only 'github-bot/gh-584'
git switch 'main'
git merge 'github-bot/gh-584'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.