0.9.14: warn about cloud saves only when the store syncs them, with advice that matches what Steam and GOG Galaxy do #155

Merged
ethan-hann merged 14 commits from integration-0914 into main 2026-10-25 23:21:59 -05:00
Owner

Closes #152, #153 and #154.

The editor told every player to turn off cloud saves. Tests with real clients (Balatro on Steam on two PCs, Deus Ex on GOG Galaxy) showed both stores keep the saves SavePoint changes and upload them, restore saves SavePoint removed at the next launch, and that Steam asks (Cloud Conflict) rather than overwriting when a second PC has a newer copy. D56 records the findings.

SavePoint now reads each game's cloud setting: Steam's cloudenabled in the active account's sharedconfig.vdf (a missing key with remotecache.vdf present reads as on), and GOG Galaxy's ProductSettings.cloudStorage from a copy of galaxy-2.0.db (Windows only, never the live file, checked for a torn copy, cached per session). The note shows per store only when cloud is on or unknown, and follows edits to the app id, folder and launch link. Microsoft.Data.Sqlite is added for the Galaxy read and left out of the Linux and macOS publishes.

Also: the developer guide and AGENTS.md now say CI gates pull requests only and the docs site publishes from main only. Version 0.9.14.

Each change was reviewed by a separate reviewer and fixed. The full Windows gate passed locally (15,589 tests).

Closes #152, #153 and #154. The editor told every player to turn off cloud saves. Tests with real clients (Balatro on Steam on two PCs, Deus Ex on GOG Galaxy) showed both stores keep the saves SavePoint changes and upload them, restore saves SavePoint removed at the next launch, and that Steam asks (Cloud Conflict) rather than overwriting when a second PC has a newer copy. D56 records the findings. SavePoint now reads each game's cloud setting: Steam's cloudenabled in the active account's sharedconfig.vdf (a missing key with remotecache.vdf present reads as on), and GOG Galaxy's ProductSettings.cloudStorage from a copy of galaxy-2.0.db (Windows only, never the live file, checked for a torn copy, cached per session). The note shows per store only when cloud is on or unknown, and follows edits to the app id, folder and launch link. Microsoft.Data.Sqlite is added for the Galaxy read and left out of the Linux and macOS publishes. Also: the developer guide and AGENTS.md now say CI gates pull requests only and the docs site publishes from main only. Version 0.9.14. Each change was reviewed by a separate reviewer and fixed. The full Windows gate passed locally (15,589 tests).
The gate no longer runs on pushes to main: main takes fast-forward merges only, so the commit that lands is the one its pull request passed, and the second run only loaded the shared runners. It can still be started by hand. The docs site no longer publishes on release tags, since the tag's commit was already published from main.
The editor always told players to turn off cloud saves. On one PC Steam keeps the
local files and uploads them at exit, so the real risk is another PC with newer
cloud saves. A new GetCloudSavesAsync reads the store's own switch (On, Off,
Unknown) and the editor shows a note only for On or Unknown, loaded off the UI
thread with the rest of the editor's details.

Steam: sharedconfig.vdf cloudenabled for the most recent account in
loginusers.vdf (the only account folder when there is none). GOG Galaxy
(Windows only): featureCloudSaves in config.json, then a read-only query of a
temp copy of galaxy-2.0.db plus -wal/-shm, deleted afterwards. Adds
Microsoft.Data.Sqlite 10.0.14 (MIT) with SQLitePCLRaw 2.1.13 (Apache-2.0) and
notices rows. Replaces gameEditor.cloudSaves with .on and .unknown.

Observed reds (assertion failures against a stub returning Unknown / empty):
- SteamCloudReaderTests: A_game_with_cloudenabled_1_is_on_for_the_most_recent_account
  (Expected On, Actual Unknown); ..._0_is_off; Without_loginusers_a_single_account_folder_is_used;
  The_most_recent_account_decides_when_several_accounts_have_files
- GalaxyCloudReaderTests: A_row_with_cloud_storage_1_is_on, _0_is_off, A_game_with_no_row_is_off
  (Expected Off, Actual Unknown), the global switch tests, and the write-ahead-log test
- CloudSaveLookupTests: 4 of 6 failed (Expected On/Off, Actual Unknown)
- GameEditorCloudSavesTests: 5 of 6 failed (note empty / StartsWith mismatch)
Mutation checks, each caught: skipping the copy deletion (2 copy-deleted tests),
Count >= 1 for the single-account rule (1 test), dropping the IsVisible binding
(hidden-when-off view test), wiring the lookup with no readers (2 GamesApi tests).
The gate no longer runs on pushes to main and the docs workflow no longer publishes on tags; the developer guide and AGENTS.md still described the old triggers.
Tests with real clients showed both stores keep changed saves and upload them, but restore removed saves at the next launch; Steam raises a Cloud Conflict on a second PC instead of overwriting. D56 records the findings and where each store keeps its cloud setting; the guides drop the blanket advice to turn cloud saves off.
The answer now names its store (CloudSaveInfo) so the editor shows a Steam or a
GOG Galaxy note; the On texts say the store brings back saves SavePoint removed.

Steam: pick the account from the signed-in user in the registry, then MostRecent,
AutoLogin, the only listed user, the newest lowercase timestamp, then the single
userdata folder (current loginusers.vdf files carry no MostRecent). A game with
no cloudenabled key counts as On when remotecache.vdf exists. Files are opened
with sharing.

Galaxy: no longer copies the -shm file; reads the header change counter and the
db and wal size and time before and after the copy, retries once, then Unknown;
keeps all flags for the session keyed on those sizes and times; sweeps copies a
crash left behind; catches InvalidCast, missing native library and type init
failures. The copy folder is set through BackendOptions and the test harnesses
point Galaxy and the Steam registry read at empty folders.

Observed reds (assertion failures against the previous behavior):
- SteamCloudReaderTests: 5 of 22 failed (remotecache On, only listed user,
  largest timestamp, active user first, AutoLogin; Expected Off/On, Actual Unknown)
- GalaxyCloudReaderTests: 8 of 23 failed (shm copied, retry once, always changing
  Unknown, moved change counter, copied once for all games, changed db read again,
  text flag, leftover sweep) against a stub with CopiesMade 0
- CloudSaveLookup store field: the lookup returned CloudStore.None; mutation
  check confirmed 2 tests fail (Expected Store = Gog, Actual None)
- GameEditorCloudSavesTests: swapping the GOG text for the Steam text fails the
  GOG On test (mutation check)
The cache now compares the full fingerprint, change counter included, like the
before/after check. The comment says that in WAL mode the log's size and time are
what show a write. New test: a change that only reached the log is read again.

Observed red (mutation, the test passed on its first run): comparing only the db
size and time in the cache key failed A_change_that_only_reached_the_write_ahead_log_is_read_again
(Expected Off, Actual On).
Only the Windows GOG Galaxy reader opens SQLite, but every RID's publish carried
libe_sqlite3 (1.5 to 1.7 MB) and about 270 KB of managed DLLs. The App now lists each
SQLite package directly with ExcludeAssets=runtime;native when RuntimeIdentifier is
linux* or osx*, which overrides how Core brings them in. Windows publishes and
RID-less builds (the tests) keep them.

Red observed: SqlitePackagingTests, Assert.NotNull() Failure: Value is null for each
package, and Assert.Contains() Failure: Item not found in set for the central versions.
A new GetCloudSavesAsync(CloudSaveQuery) overload takes the install folder, Steam
app id and launch link from the form, so the check works before a game is saved.
The editor asks again 400 ms after the last change to the app id or folder; each
change cancels the pause and bumps a version counter, so an answer to an earlier
question (including the first load) never replaces a newer one.

Observed reds:
- GamesApiCloudSavesTests: 4 new tests failed against a stub overload that
  returned Unknown/None (Expected On/Steam, Actual Unknown/None; Expected Gog,
  Actual None; the bad token expected a failure, got success)
- GameEditorCloudSavesFollowTests: 6 of 6 failed before the editor re-checked
  ("The editor never got that far" from the polling helper, since no second
  check was made)
Mutation check: dropping the version and cancellation guards made the late-answer
test and the first-load test fail.
The first load now takes its version when the editor is built and no longer bumps
it, so an edit made while the folder status loads is the newer question and its
answer is kept. Closing the editor counts as a newer question; the version is the
only guard. A changed launch link or start method also re-runs the check.

The form overload returns Unknown for a half-typed or unresolvable folder instead
of failing, so typing does not log a warning at every pause. The fake honors a
cancelled token and a queued failure like the real Api, and the contract scenario
covers the overload (form, half-typed folder, cancelled).

Adds a test that the Microsoft.Data.Sqlite pins equal the versions the pinned
nuspecs depend on, and a csproj note that the condition reads RuntimeIdentifier.

Observed reds:
- GameEditorCloudSavesFollowTests: An_edit_made_while_the_folder_status_is_still_loading_keeps_its_own_answer
  (note started with the Steam text, Expected the unknown text); the two launch
  link tests timed out ("The editor never got that far")
- GamesApiCloudSavesTests: the bad-token form (Expected Ok True, Actual False)
- BackendContractTests: fake answered the cancelled form check with success,
  real with error.operation.cancelled
Mutation checks: removing the version guard failed the late-answer and the
closed-editor tests; removing the version bump in Dispose failed the closed-editor
test; changing a dependency in the Microsoft.Data.Sqlite nuspec failed the pin test.
Version 0.9.14, and regenerate the Add a game screenshot with the new cloud-saves note
Some checks failed
Release / linux (push) Failing after 34s
Release / checksums (push) Has been skipped
Docs / site (pull_request) Successful in 1m27s
Gate / linux (pull_request) Successful in 14m22s
Release / windows (push) Failing after 30s
Gate / windows (pull_request) Successful in 34m29s
Docs / site (push) Successful in 1m20s
0723a19e33
Sign in to join this conversation.
No reviewers
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!155
No description provided.