Game saves: an empty configuration id no longer deletes the other configurations' saves #209
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!209
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/209/head"
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?
@Maraco91 on GitHub · 2026-11-24 01:27 UTC · original
Maraco91:xgamesave/empty-configuration-id→main· +30 −2 · 1 files · 1 commits · merged 2026-11-24 07:56 UTCWhat
XGameSaveInitializeProviderwith an empty configuration id ("", not null) deletes the saves of every other configuration of that user.Provider::openbuilds the provider's folder as<saves>\<xuid>\<file_name(config)>, with"default"for a null id. For""the file name is empty, so the folder is<saves>\<xuid>itself: the folder the configurations' own folders are in.openthen callscontainers(&root)to convert containers of the old layout, which it recognises as folders with no~and no dot in their name. A configuration's folder (default, a GUID, ..) is exactly that, so for each onemigrate:remove_dir_alls the configuration's folder, with every container in it.An empty id is now treated like a null one: the default configuration. Nothing else changes; named configurations get the folders they had.
What I do not know: what the console's runtime answers for
""(it may refuse it). Treating it as the default keeps the call working, as it does today, and I preferred that to turning a success into an error on a guess; if the right answer is a refusal, the same line can return it. I have not seen a title pass""(I have no game files). The cost when one does is the user's saves, which is why I think it is worth closing.Tested
Windows 11 Pro 10.0.26200, rustc 1.98.1 (
x86_64-pc-windows-msvc), no game data, no GPU involved. Saves go to a temporary folder.New unit test
an_empty_configuration_id_is_the_default_one: writes a save under configurationscid, opens a provider with"", and checks thatscid's folder and save are still there and that the provider is the default one's (same folder as a null id). Controls: the default,scidand a third configuration stay apart (the new ones are empty,scid's save is unchanged after all three were opened).main(d2a4bae) + the test only:cargo test -p victory-hle --lib an_empty_configurationfails:another configuration's saves are gone(the folder was removed).cargo test -p victory-hle --lib xgamesave::: 6 passed, 0 failed (the 5 existing ones, among them the old-layout conversion and the kill-at-any-step test, and the new one).cargo clippy -p victory-hle --tests: nothing inxgamesave.rs.rustfmt --check: nothing in the lines changed (the file has existing differences elsewhere).cargo xtask policy: 151 files ok.Not tested: a title run.
AI-assisted (Claude Code); the tests above were run on the machine described.
🤖 Generated with Claude Code
@jeremygold02 on GitHub · 2026-11-24 04:57 UTC · original
Thanks @Maraco91 for covering the empty configuration ID against an existing named save.
I tested commit
c88b7ac1cce4d2d3b12d761bd66632f65a5a6e23with:The targeted test passed (1 passed, 0 failed; 86 filtered). It creates data under a named
scidconfiguration, opens a provider with an empty ID and one with no ID, then verifies the empty ID resolves to the default root without deleting thesciddata. It also checks that the default remains separate from named configurations and that opening another named configuration does not disturb the saved data.The test at this commit uses a temporary directory and the local provider implementation; it does not exercise a real title or Xbox service integration.