startup: reject new updates on a closed save container #1969
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1976"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by avt0m4t48 on 2026-11-24T22:27:00Z.
Refs #1200. A pending update pins the container name until that update ends. Creating another update requires a live container reference, so use the reference count for that check. The source-built fixture closes a container while its first update is open, checks that the first update still resolves the pinned name, and checks that the closed container cannot start a second update.
g++ -std=c++17 -O2 -Wall -Wextra -pedantic -pthread -Isrc/startup_stubs tests/startup_gamesave_persist.cpp -o <test>followed by running the binary passed on Linux (GCC 14.2). The added assertion fails on the originalsave_store.h. The focused save enumeration, cross-process publication, lock and blob-packing controls also passed. Windows provider execution and the reported second-start setup behavior remain unverified.Source-built inputs only. AI-assisted using Codex.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T22:30:29Z.
Built and ran it on Windows/MSVC — the platform the description leaves unverified
Windows 11 build 26300.9974, MSVC 19.44,
devpreset:(The other nine
gamesaveentries in that filter report "Not Run" because they need executables I did not build — my selection, notthe PR.)
Two mutations, both caught
refs_[container] == 0→names_[container].empty()(the original check)container >= capacity || refs_[container] == 0→container >= capacityonlyThe first is the one that matters: it is the pre-change line, so the fixture genuinely fails without the fix rather than merely
passing with it. The second shows the reference-count check is not decorative — dropping it accepts a closed container with a name
still pinned by the pending update.
Why the reference count is the right predicate here
A pending update keeps the name alive after the container is closed, so
names_[container].empty()answers "does this slot have aname", not "can I start an update". Using
refs_asks the question the caller actually needs, and the fixture's sequence — open,start update, close, resolve the pinned name, then try a second update — is the shortest one that distinguishes the two.
What is unverified
The Windows provider path and the reported second-start behaviour, as the description says, are not exercised here; the fixture is a
host-side model of the store. Whether the real provider pins the name across a close is a claim about the provider, not about this
header.
Verdict
Reviewed. One-line change, the fixture fails on the old line, and both halves of the condition are pinned.
Notes