feat(saves): sync saves between devices through a folder the player picks #275

Open
dukenheimer wants to merge 13 commits from dukenheimer/LongshotLauncher:feat/save-sync into main
First-time contributor

Players with a PC and a Steam Deck have no way to keep one adventure on both: they copy saves by hand or play two. This adds an opt-in sync through a folder both devices already reach (a OneDrive, Dropbox, Google Drive or Nextcloud folder, or a network share), with no server and no account of ours.

What changed

  • Saves page, Sync with your other devices: a Sync saves through a folder tick, the folder, when this device last synced, Sync now (the same sync as before Play, conflicts too, without starting the game) and Change folder…. It is off until a folder is picked. Picking one that already holds another device's save asks which to keep there and then. (It started in Settings; the Deck test showed it belongs with the saves.) The status line names the other device the folder's save came from ("Last synced 5 minutes ago, with STEAMDECK's save from 20:11"). A folder only this device has synced with says so, there, on picking it, and on the home after a game. In the first live test the PC and the Deck had picked two different folders, and each reported itself in sync.
  • The controller on long pages (found testing on the Deck): Avalonia's directional move only sees the controls on screen, so on Settings the d-pad stopped at the last one in view and the rest of the page was out of reach. Up and Down now go on to the next control in the page and scroll it into view (PadInput.PastTheFold), and a page with no main button starts on its first control rather than its footer's Release notes. In the TV view a drag on the touchscreen scrolls the page (Gaming Mode hands the window the touchscreen as a mouse). docs/controller.md says so.
  • Before Play (Home, the Ready screen, and --play, which Steam runs on the Deck): when only the sync folder's save changed since this device and the folder last agreed, or this device has none, it comes in through the existing whole-folder import (SaveArchive.ImportWhole), this device's backed up first (sync-local-<stamp>). When only this device's changed, it goes out. In the window this runs off the UI thread.
  • After the game: the launcher waits for the game (also under --play, and after its window is closed, with the home released so it can open again) and sends this device's save, unless the sync was turned off or moved meanwhile.
  • Which is newer is decided by the save's content, never by clocks. Each device records, in save-sync.json in the launcher's home, the content it last agreed on with the folder. Each manifest lists the contents its save was made from, so two saves sent apart while a cloud client lagged are a conflict and never mistaken for newer.
  • Conflicts never overwrite silently. In the window, Play asks which save to keep (SyncConflictView); the choice is bound to the save shown, and a newer one is asked about again. Under --play, both before and after the game, this device's is kept and the folder's is set aside as sync-other-<stamp>. The window says so once when it next opens. Both kinds of backup are listed in Restore from a backup… (BackupKind.Sync).
  • The folder holds Longshot saves.json and the zip it names, Longshot saves sync-<id>.zip (the same whole-folder zip as Export saves… > A .zip file…), plus Longshot saves.lock while a device writes. Each write uses a new zip name: the zip is built and verified in temp (it unpacks whole to exactly the manifest's content), copied in, and the manifest is re-read and the lock re-checked before an atomic rename replaces it. Only then is the old zip deleted. A cut-short write always leaves the manifest naming a zip that exists. The zip is copied out and checked before unpacking, so OneDrive Files On-Demand placeholders work. The player's own Longshot saves <date>.zip is never touched.
  • Edge cases:
    • an unreachable folder is skipped and the game plays (the home says so);
    • nothing syncs while a game runs;
    • a manifest that doesn't read, a zip that doesn't match it, or another device's fresh lock is retried for a few seconds, then left for the next time;
    • a lock carries a per-install id (two Steam Decks share a hostname) and is believed for two minutes;
    • a broken manifest never throws into Play.
  • save-work, the game's working copy, never syncs: it is left out of the zip and the content hash at any depth, and an import keeps the local one where it was. The save folder stays a plain folder where it always was: nothing is linked into the cloud folder, so backup or cloud tools that walk the save folder see plain files (the concern behind #258). This doesn't fix #258 itself: GoodSync there trips over the junction each Windows build's user\save already is, which this PR doesn't touch.
  • SaveArchive: ExportSave gains leaveOut, and ImportWhole gains backupName and keepLocal. Export now also leaves out what a file manager adds (desktop.ini, Thumbs.db, .DS_Store), which import already ignored. A folder holding only those, or only links, goes in as an empty folder, so a zip unpacks to the folder as the hash sees it.
  • Setting up a cloud folder: a guide in docs/saves.md, opened from How do I set up a cloud folder? under the sync on the Saves page. It covers the service's own app on Windows; on the Steam Deck, rclone copy-pasteable in Konsole with no root (download, rclone config sign-in for OneDrive, Google Drive and Dropbox, WebDAV with an app password for Nextcloud, and a systemctl --user mount service with the tuned options); Syncthing as the no-cloud option; and how to switch services. OneDrive, Google Drive and Dropbox have no SteamOS app.
  • Docs: docs/saves.md, Sync through a folder and Setting up a cloud folder, and the backups and tests lists; docs/controller.md; README's Saves row, a Playing on a PC and a Steam Deck? paragraph, and the Core row.

Merged with main

  • #151 (Play through the Steam tile): the window syncs before it hands Play to the tile. The tile's --play arrival is what starts the game, so it waits for the game and sends the save after it. StartFolder returns no game when it routed.

Residual risks (known, documented)

  • Two cloud clients publishing at the same moment while neither has replicated the other can still both replace the manifest. Revision history turns most of these into a conflict at the next Play rather than a silent loss, and every replaced save is in that device's backups.
  • A second launcher starting the game while another is importing waits up to 10 s for the gather lock, then plays without syncing. An import takes well under that.

CONTRIBUTING's rule

"No saves leave your PC" is about contributors and this repository. Here the player's own saves go only to a folder the player picked, and only once they turn the sync on. Maintainers may want to say so in the privacy page.

Tests

  • tests/launcher_core/SaveSyncChecks.cs (new, two made-up devices, fake saves) covers:
    • the newer save each way, and a device that is only behind;
    • conflicts kept on either side, with no window before and after the game, and a stale choice asked again;
    • two saves made apart while a cloud client lagged, and a history past its cap;
    • a folder that is offline or still being written, and a manifest that is broken, missing fields, points outside or comes from a newer launcher;
    • another device's lock, fresh or stale;
    • a write cut short, orphan sync zips (and the player's own export kept), and a missing zip re-sent;
    • save-work beside the save, in a profile and in a slot, including a slot the other device dropped;
    • junk-only folders, and a folder picked anew.
  • python -I tests/test_launcher_core.py: 2858 checks passed (after merging main, up to #276) on Linux (WSL Ubuntu 24.04, .NET SDK 10.0.404), translations check clean. On Windows the new checks pass too. Two suites, SavesChecks' link check and SteamChecks, fail on that PC on unmodified main as well, so they were skipped there (2360 passed).
  • tests/launcher_app (the app-level checks, with the wait for a game handed over to another process): pass.
  • Tooling's tests/test_release.py at .tooling-rev: 42 tests OK.
  • dotnet build LongshotLauncher.slnx: 0 warnings, 0 errors.
  • Reviewed in three passes by a GPT-6.2 Astra code-review agent. Every finding was addressed, except the two risks above.

Tested by hand

Dev builds on Brett's PC (Windows 11) and Steam Deck (SteamOS, Game Mode via Steam), through his OneDrive: the PC through the OneDrive client, the Deck through an rclone mount of the same folder (as in the new docs note).

  • Settings could not be scrolled with the controller on the Deck, and the sync belonged on the Saves page: both fixed here.
  • In the first round trip the two devices had picked different folders and each reported itself in sync: the status and warnings above came from that.
  • Round trip through the shared folder (20:24–20:25): the Deck sent its save after a game; the PC, which had played meanwhile, showed the conflict, Brett chose the Deck's, and it came in with the PC's backed up first (sync-local-20261124-202524).
  • On the PC, the game process the launcher started ended 40 s in while Longshot went on, so the sync after the game refused (a game running) and the PC's save was not sent. Play and --play now wait for the started process and then for no game running (LauncherService.WaitForGameEnd, checked in tests/launcher_app).

Screenshots

The Saves page with the sync on:

saves-sync

The TV view (Steam's Gaming Mode), Sync now reached with the d-pad:

tv-saves

Both from tools/screenshots (saves-sync, tv-saves); the conflict dialog's is still to come.

Measurements

Off by default: nothing changes for a player who doesn't turn it on. When on, Play waits for:

  • one hash of the save folder (a few hundred KB);
  • reading the manifest, plus copying and checking a small zip when the other side changed;
  • after the game, one zip.
Players with a PC and a Steam Deck have no way to keep one adventure on both: they copy saves by hand or play two. This adds an opt-in sync through a folder both devices already reach (a OneDrive, Dropbox, Google Drive or Nextcloud folder, or a network share), with no server and no account of ours. ## What changed - **Saves page, Sync with your other devices:** a *Sync saves through a folder* tick, the folder, when this device last synced, **Sync now** (the same sync as before Play, conflicts too, without starting the game) and *Change folder…*. It is off until a folder is picked. Picking one that already holds another device's save asks which to keep there and then. (It started in Settings; the Deck test showed it belongs with the saves.) The status line names the other device the folder's save came from ("Last synced 5 minutes ago, with STEAMDECK's save from 20:11"). A folder only this device has synced with says so, there, on picking it, and on the home after a game. In the first live test the PC and the Deck had picked two different folders, and each reported itself in sync. - **The controller on long pages** (found testing on the Deck): Avalonia's directional move only sees the controls on screen, so on Settings the d-pad stopped at the last one in view and the rest of the page was out of reach. Up and Down now go on to the next control in the page and scroll it into view (`PadInput.PastTheFold`), and a page with no main button starts on its first control rather than its footer's *Release notes*. In the TV view a drag on the touchscreen scrolls the page (Gaming Mode hands the window the touchscreen as a mouse). `docs/controller.md` says so. - **Before Play** (Home, the Ready screen, and `--play`, which Steam runs on the Deck): when only the sync folder's save changed since this device and the folder last agreed, or this device has none, it comes in through the existing whole-folder import (`SaveArchive.ImportWhole`), this device's backed up first (`sync-local-<stamp>`). When only this device's changed, it goes out. In the window this runs off the UI thread. - **After the game:** the launcher waits for the game (also under `--play`, and after its window is closed, with the home released so it can open again) and sends this device's save, unless the sync was turned off or moved meanwhile. - **Which is newer** is decided by the save's content, never by clocks. Each device records, in `save-sync.json` in the launcher's home, the content it last agreed on with the folder. Each manifest lists the contents its save was made from, so two saves sent apart while a cloud client lagged are a conflict and never mistaken for newer. - **Conflicts never overwrite silently.** In the window, Play asks which save to keep (`SyncConflictView`); the choice is bound to the save shown, and a newer one is asked about again. Under `--play`, both before and after the game, this device's is kept and the folder's is set aside as `sync-other-<stamp>`. The window says so once when it next opens. Both kinds of backup are listed in *Restore from a backup…* (`BackupKind.Sync`). - **The folder** holds `Longshot saves.json` and the zip it names, `Longshot saves sync-<id>.zip` (the same whole-folder zip as *Export saves… > A .zip file…*), plus `Longshot saves.lock` while a device writes. Each write uses a new zip name: the zip is built and verified in temp (it unpacks whole to exactly the manifest's content), copied in, and the manifest is re-read and the lock re-checked before an atomic rename replaces it. Only then is the old zip deleted. A cut-short write always leaves the manifest naming a zip that exists. The zip is copied out and checked before unpacking, so OneDrive Files On-Demand placeholders work. The player's own `Longshot saves <date>.zip` is never touched. - **Edge cases:** - an unreachable folder is skipped and the game plays (the home says so); - nothing syncs while a game runs; - a manifest that doesn't read, a zip that doesn't match it, or another device's fresh lock is retried for a few seconds, then left for the next time; - a lock carries a per-install id (two Steam Decks share a hostname) and is believed for two minutes; - a broken manifest never throws into Play. - **`save-work`**, the game's working copy, never syncs: it is left out of the zip and the content hash at any depth, and an import keeps the local one where it was. The save folder stays a plain folder where it always was: nothing is linked into the cloud folder, so backup or cloud tools that walk the save folder see plain files (the concern behind #258). This doesn't fix #258 itself: GoodSync there trips over the junction each Windows build's `user\save` already is, which this PR doesn't touch. - **`SaveArchive`:** `ExportSave` gains `leaveOut`, and `ImportWhole` gains `backupName` and `keepLocal`. Export now also leaves out what a file manager adds (`desktop.ini`, `Thumbs.db`, `.DS_Store`), which import already ignored. A folder holding only those, or only links, goes in as an empty folder, so a zip unpacks to the folder as the hash sees it. - **Setting up a cloud folder:** a guide in docs/saves.md, opened from *How do I set up a cloud folder?* under the sync on the Saves page. It covers the service's own app on Windows; on the Steam Deck, rclone copy-pasteable in Konsole with no root (download, `rclone config` sign-in for OneDrive, Google Drive and Dropbox, WebDAV with an app password for Nextcloud, and a `systemctl --user` mount service with the tuned options); Syncthing as the no-cloud option; and how to switch services. OneDrive, Google Drive and Dropbox have no SteamOS app. - **Docs:** docs/saves.md, *Sync through a folder* and *Setting up a cloud folder*, and the backups and tests lists; docs/controller.md; README's Saves row, a *Playing on a PC and a Steam Deck?* paragraph, and the Core row. ## Merged with main - **#151 (Play through the Steam tile):** the window syncs before it hands Play to the tile. The tile's `--play` arrival is what starts the game, so it waits for the game and sends the save after it. `StartFolder` returns no game when it routed. ## Residual risks (known, documented) - Two cloud clients publishing at the same moment while neither has replicated the other can still both replace the manifest. Revision history turns most of these into a conflict at the next Play rather than a silent loss, and every replaced save is in that device's backups. - A second launcher starting the game while another is importing waits up to 10 s for the gather lock, then plays without syncing. An import takes well under that. ## CONTRIBUTING's rule "No saves leave your PC" is about contributors and this repository. Here the player's own saves go only to a folder the player picked, and only once they turn the sync on. Maintainers may want to say so in the privacy page. ## Tests - `tests/launcher_core/SaveSyncChecks.cs` (new, two made-up devices, fake saves) covers: - the newer save each way, and a device that is only behind; - conflicts kept on either side, with no window before and after the game, and a stale choice asked again; - two saves made apart while a cloud client lagged, and a history past its cap; - a folder that is offline or still being written, and a manifest that is broken, missing fields, points outside or comes from a newer launcher; - another device's lock, fresh or stale; - a write cut short, orphan sync zips (and the player's own export kept), and a missing zip re-sent; - `save-work` beside the save, in a profile and in a slot, including a slot the other device dropped; - junk-only folders, and a folder picked anew. - `python -I tests/test_launcher_core.py`: **2858 checks passed** (after merging main, up to #276) on Linux (WSL Ubuntu 24.04, .NET SDK 10.0.404), translations check clean. On Windows the new checks pass too. Two suites, `SavesChecks`' link check and `SteamChecks`, fail on that PC on unmodified `main` as well, so they were skipped there (2360 passed). - `tests/launcher_app` (the app-level checks, with the wait for a game handed over to another process): pass. - Tooling's `tests/test_release.py` at `.tooling-rev`: 42 tests OK. - `dotnet build LongshotLauncher.slnx`: 0 warnings, 0 errors. - Reviewed in three passes by a GPT-6.2 Astra code-review agent. Every finding was addressed, except the two risks above. ## Tested by hand Dev builds on Brett's PC (Windows 11) and Steam Deck (SteamOS, Game Mode via Steam), through his OneDrive: the PC through the OneDrive client, the Deck through an rclone mount of the same folder (as in the new docs note). - Settings could not be scrolled with the controller on the Deck, and the sync belonged on the Saves page: both fixed here. - In the first round trip the two devices had picked different folders and each reported itself in sync: the status and warnings above came from that. - Round trip through the shared folder (20:24–20:25): the Deck sent its save after a game; the PC, which had played meanwhile, showed the conflict, Brett chose the Deck's, and it came in with the PC's backed up first (`sync-local-20261124-202524`). - On the PC, the game process the launcher started ended 40 s in while Longshot went on, so the sync after the game refused (a game running) and the PC's save was not sent. Play and `--play` now wait for the started process and then for no game running (`LauncherService.WaitForGameEnd`, checked in `tests/launcher_app`). ## Screenshots The Saves page with the sync on: ![saves-sync](https://git.magicbean.dev/attachments/0d5c81a9-4e6b-44a8-94e2-087e09ed05f6) The TV view (Steam's Gaming Mode), Sync now reached with the d-pad: ![tv-saves](https://git.magicbean.dev/attachments/f830cbb3-1491-4aff-ad78-a7c87bd55375) Both from `tools/screenshots` (`saves-sync`, `tv-saves`); the conflict dialog's is still to come. ## Measurements Off by default: nothing changes for a player who doesn't turn it on. When on, Play waits for: - one hash of the save folder (a few hundred KB); - reading the manifest, plus copying and checking a small zip when the other side changed; - after the game, one zip.
Settings > Sync saves through a folder keeps Longshot's save the same on a PC and a Steam Deck through a cloud or network folder: before Play the newer save comes in (this device's backed up first), after the game this device's goes out, written atomically with a manifest. Which side changed is told by content, not clocks; a conflict is asked in the window and, under --play, keeps this device's and sets the other aside in the backups. Offline, running or still-syncing folders are left alone; save-work never syncs.

Co-authored-by: Copilot App <[email protected]>
Each manifest names the contents its save was made from, so two saves sent apart while a cloud client lagged are a conflict, never taken as newer. The manifest is read again under the folder's lock; zips get their own names and the manifest is committed last; the zip is copied out and checked before unpacking (OneDrive placeholders); locks carry a per-install id. --play settles a conflict at exit as before the game, a device only behind is not a conflict, a broken manifest never throws, Play syncs off the window's thread, the launcher waits for a running game after its window closes, save-work is kept at any depth, and junk-only folders hash and zip alike.

Co-authored-by: Copilot App <[email protected]>
Sync zips are named Longshot saves sync-<12 hex>.zip, so a player's own Longshot saves <date>.zip is never read or deleted. The zip is built and verified in temp (unpacks whole to the manifest's content) and the manifest and lock are re-checked just before publishing. A missing zip for this device's save is re-sent, not called in sync. History keeps 1000 entries and an unchanged device past it takes the newest. A delayed post-game push re-reads the settings. Conflict choices are bound to the save shown. Folders kept only for save-work hash and zip alike.

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Brett's test on the Deck: Settings would not scroll with the controller, and the sync belongs with the saves. Avalonia's directional move only sees the controls on screen, so Up/Down now go on to the next control in the page and scroll it into view; a page with no main button starts on its first control, not its footer; in the TV view a touchscreen drag scrolls. The sync moves to the Saves page with Sync now and when it last synced.

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Brett's first live test: the PC and the Deck had picked two different folders, and each sync reported InSync with its own save. The status line now names the other device last synced with; a folder no other device synced with says so on the Saves page, when picked, and on the home after a game.

Co-authored-by: Copilot App <[email protected]>
docs(saves): a cloud folder on the Steam Deck (rclone, Syncthing), and how the sync stands to #258
Some checks failed
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Compile and test (pull_request) Has been cancelled
c295bce2af
Co-authored-by: Copilot App <[email protected]>
Member

Possibly related, for context:

  • issue MagicBeanDev/Longshot#1345 Idea: ROMM Save Sync — Requests cross-device save syncing, though via ROMM
  • PR #183 WIP: feat(saves): one slot at a time: export it, copy it to another slot, delete it, or restore it alone from a backup — Open Saves-page feature may overlap edits to saves UI
Possibly related, for context: - issue MagicBeanDev/Longshot#1345 Idea: ROMM Save Sync — Requests cross-device save syncing, though via ROMM - PR #183 WIP: feat(saves): one slot at a time: export it, copy it to another slot, delete it, or restore it alone from a backup — Open Saves-page feature may overlap edits to saves UI
fix(saves): the save goes out after the whole game, not when the process the launcher started ends
Some checks failed
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Compile and test (pull_request) Has been cancelled
49cbbe6f89
Brett's PC: the game process the launcher started ended 40 s in while Longshot went on, and the sync after it refused (a game running), so the save was not sent. Play and --play now wait for the started process, then for no game running.

Co-authored-by: Copilot App <[email protected]>
dukenheimer changed title from WIP: feat(saves): sync saves between devices through a folder the player picks to feat(saves): sync saves between devices through a folder the player picks 2026-11-25 05:00:10 +00:00
Play through the Steam tile starts the game in the tile's --play arrival: the window syncs before it hands off, and the arrival waits for the game and sends the save after it. StartFolder returns no game when it routed.

Co-authored-by: Copilot App <[email protected]>
fix(steam): the Ready screen's tile art takes its build's folder (main did not build: Job in ReadyViewModel)
Some checks failed
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Compile and test (pull_request) Has been cancelled
5018fb866d
#260's WriteTileArt read Job.InstallDir; ReadyViewModel has no Job, and its Entry.Folder is that folder.

Co-authored-by: Copilot App <[email protected]>
docs(saves): setting up a cloud folder (Windows apps, rclone on the Deck, Syncthing), linked from the Saves page
Some checks failed
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Compile and test (pull_request) Has been cancelled
eb87f6ddbb
Co-authored-by: Copilot App <[email protected]>
Merge main (#272 needs-nightly-launcher dialog, #276 the tile-art build fix) into feat/save-sync
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Compile and test (pull_request) Blocked by required conditions
5c0b7eca4c
Co-authored-by: Copilot App <[email protected]>
Author
First-time contributor

Follow-up: a built-in cloud account (bundled rclone, no mount or setup on the Deck) is proposed in #277.

Follow-up: a built-in cloud account (bundled rclone, no mount or setup on the Deck) is proposed in #277.
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The sync can replace a save while a game or another save operation is using it, and an unmounted folder can be mistaken for an empty shared folder. The conflict history can also classify a divergent save as a descendant and replace it without asking.

Adds opt-in save synchronization through a player-selected folder, conflict handling, backups, controller scrolling and setup guidance. It makes moving an adventure between devices easier, but the current coordination and ancestry checks can put progress at risk.

Blocking (4): must change before merging.

  1. L1 Core/SaveSync.cs:195: The gather lock does not exclude the game or the other save-writing operations for the duration of an import. (more on the line) Do: Coordinate game startup and every operation that changes the shared save with the same cross-process lock, holding it through the save swap or edit and through the game-start decision. Recheck running state after acquiring it.
  2. L2 Core/SaveSync.cs:210: A full history is treated as proof of ancestry even when it contains no common save. (more on the line) Do: Treat missing ancestry as unknown and ask about the conflict, or use an ancestry representation that can prove the relationship beyond the history cap.
  3. L3 Core/SaveSync.cs:175: Clearing a parked-conflict notice rewrites the sync state without the lock used by sync operations. (more on the line) Do: Read, clear and write the parked fields under the same cross-process lock as every other state update.
  4. L4 Core/SaveSync.cs:191: An existing empty mount point is treated as a reachable, new sync folder. (more on the line) Do: Detect an unavailable configured mount before treating an empty directory as a new shared folder, and report it as unreachable. Preserve a marker or equivalent identity that also distinguishes a previously used folder from an empty replacement.

@fix can do L1, L2, L3 and L4.

Checks: Still running: CI / Conventional Commit title (pull_request), CI / Compile and test (pull_request).

More: does it help, other systems, switches, what was read

Does it help: Unproven as a reliable sync: the author reports a successful Windows PC–Steam Deck OneDrive round trip and automated checks, but the cases in the review are not covered by those runs. This is not a performance change.

Other systems: The sync affects save imports, the save editor, simultaneous launcher processes, Steam's unattended launch, network shares and asynchronously replicated cloud folders on Windows and Linux. The reported round trip covers OneDrive and rclone; it does not cover the coordination and divergent-history cases below.

Switches: Sync saves through a folder is added, off by default, with a remembered folder. Opt-in is appropriate, but the enabled behavior needs the fixes below.

Reviewed: 5c0b7eca4c against 3af691ed6d: Read AGENTS.md and CONTRIBUTING.md; the named review checklist and pull request template are absent. Read the sync implementation, archive changes, launch and UI diffs, sync checks, and relevant save and setup documentation; skimmed the remaining changed UI, documentation, test and screenshot changes. The larger existing files and generated or translation content were not read in full.; nothing run (a code review).

Checked and fine:

  • Sync is off until a folder is selected.
  • The sync zip uses its own names and the export path verifies the unpacked content before publication.
  • The reported checks use invented saves; the listed commits include AI-assistance trailers.

Testing: No code or tests were run, as requested. The author reports core and app checks and a Windows–Steam Deck OneDrive round trip; CI was still running.

Overlaps and merge order: The author identifies #277 as a follow-up for built-in cloud accounts; no other overlap was established from the supplied context.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The sync can replace a save while a game or another save operation is using it, and an unmounted folder can be mistaken for an empty shared folder. The conflict history can also classify a divergent save as a descendant and replace it without asking. Adds opt-in save synchronization through a player-selected folder, conflict handling, backups, controller scrolling and setup guidance. It makes moving an adventure between devices easier, but the current coordination and ancestry checks can put progress at risk. **Blocking (4)**: must change before merging. 1. **L1** `Core/SaveSync.cs:195`: The gather lock does not exclude the game or the other save-writing operations for the duration of an import. (more on the line) **Do:** Coordinate game startup and every operation that changes the shared save with the same cross-process lock, holding it through the save swap or edit and through the game-start decision. Recheck running state after acquiring it. 2. **L2** `Core/SaveSync.cs:210`: A full history is treated as proof of ancestry even when it contains no common save. (more on the line) **Do:** Treat missing ancestry as unknown and ask about the conflict, or use an ancestry representation that can prove the relationship beyond the history cap. 3. **L3** `Core/SaveSync.cs:175`: Clearing a parked-conflict notice rewrites the sync state without the lock used by sync operations. (more on the line) **Do:** Read, clear and write the parked fields under the same cross-process lock as every other state update. 4. **L4** `Core/SaveSync.cs:191`: An existing empty mount point is treated as a reachable, new sync folder. (more on the line) **Do:** Detect an unavailable configured mount before treating an empty directory as a new shared folder, and report it as unreachable. Preserve a marker or equivalent identity that also distinguishes a previously used folder from an empty replacement. `@fix` can do L1, L2, L3 and L4. **Checks:** Still running: `CI / Conventional Commit title (pull_request)`, `CI / Compile and test (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven as a reliable sync: the author reports a successful Windows PC–Steam Deck OneDrive round trip and automated checks, but the cases in the review are not covered by those runs. This is not a performance change. **Other systems:** The sync affects save imports, the save editor, simultaneous launcher processes, Steam's unattended launch, network shares and asynchronously replicated cloud folders on Windows and Linux. The reported round trip covers OneDrive and rclone; it does not cover the coordination and divergent-history cases below. **Switches:** Sync saves through a folder is added, off by default, with a remembered folder. Opt-in is appropriate, but the enabled behavior needs the fixes below. **Reviewed:** 5c0b7eca4cbb against 3af691ed6dee: Read AGENTS.md and CONTRIBUTING.md; the named review checklist and pull request template are absent. Read the sync implementation, archive changes, launch and UI diffs, sync checks, and relevant save and setup documentation; skimmed the remaining changed UI, documentation, test and screenshot changes. The larger existing files and generated or translation content were not read in full.; nothing run (a code review). **Checked and fine:** - Sync is off until a folder is selected. - The sync zip uses its own names and the export path verifies the unpacked content before publication. - The reported checks use invented saves; the listed commits include AI-assistance trailers. **Testing:** No code or tests were run, as requested. The author reports core and app checks and a Windows–Steam Deck OneDrive round trip; CI was still running. **Overlaps and merge order:** The author identifies #277 as a follow-up for built-in cloud accounts; no other overlap was established from the supplied context. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -0,0 +172,4 @@
/// The sync-folder save a start with no window set aside in a conflict (unattended), said once: cleared as it is read
public static (string Backup, string Device, DateTime Written)? TakeParked(string statePath)
{
var state = ReadState(statePath);
Member

L3 (blocking): Clearing a parked-conflict notice rewrites the sync state without the lock used by sync operations.

When: On opening the window, TakeParked can read the old state while a simultaneous unattended sync or Sync now updates Base and writes the state under the gather lock. TakeParked can then write its stale copy back, losing the new agreement or parked notice and causing subsequent sync decisions to use the wrong base.

Do: Read, clear and write the parked fields under the same cross-process lock as every other state update.

**L3** (blocking): Clearing a parked-conflict notice rewrites the sync state without the lock used by sync operations. *When:* On opening the window, TakeParked can read the old state while a simultaneous unattended sync or Sync now updates Base and writes the state under the gather lock. TakeParked can then write its stale copy back, losing the new agreement or parked notice and causing subsequent sync decisions to use the wrong base. **Do:** Read, clear and write the parked fields under the same cross-process lock as every other state update.
@ -0,0 +188,4 @@
{
try
{
if (!Directory.Exists(p.Folder)) return new(SyncOutcome.Unreachable, p.Folder);
Member

L4 (blocking): An existing empty mount point is treated as a reachable, new sync folder.

When: With the documented Deck rclone service stopped, ~/LongshotSync still exists as an empty local directory. The launcher exports there and records an agreement; when the mount returns, the local files are hidden and the device has reported a sync that never reached the other device.

Do: Detect an unavailable configured mount before treating an empty directory as a new shared folder, and report it as unreachable. Preserve a marker or equivalent identity that also distinguishes a previously used folder from an empty replacement.

**L4** (blocking): An existing empty mount point is treated as a reachable, new sync folder. *When:* With the documented Deck rclone service stopped, ~/LongshotSync still exists as an empty local directory. The launcher exports there and records an agreement; when the mount returns, the local files are hidden and the device has reported a sync that never reached the other device. **Do:** Detect an unavailable configured mount before treating an empty directory as a new shared folder, and report it as unreachable. Preserve a marker or equivalent identity that also distinguishes a previously used folder from an empty replacement.
@ -0,0 +192,4 @@
if ((p.Running ?? (() => Saves.Running(Platforms.Current)))() is { Count: > 0 } busy)
return new(SyncOutcome.Busy, string.Join(" and ", busy) + " is running.");
FileStream held;
try { held = Saves.HoldGatherLock(p.Env); }
Member

L1 (blocking): The gather lock does not exclude the game or the other save-writing operations for the duration of an import.

When: A Sync now import can already be copying when Play's separate sync waits ten seconds for the gather lock and returns Busy; Play then starts the game. The first import can pass its running check before the game starts and subsequently swap the save folder under the running game. The UI's SyncRunning check also is only a check, and does not cover another launcher process or Progress edits.

Do: Coordinate game startup and every operation that changes the shared save with the same cross-process lock, holding it through the save swap or edit and through the game-start decision. Recheck running state after acquiring it.

**L1** (blocking): The gather lock does not exclude the game or the other save-writing operations for the duration of an import. *When:* A Sync now import can already be copying when Play's separate sync waits ten seconds for the gather lock and returns Busy; Play then starts the game. The first import can pass its running check before the game starts and subsequently swap the save folder under the running game. The UI's SyncRunning check also is only a check, and does not cover another launcher process or Progress edits. **Do:** Coordinate game startup and every operation that changes the shared save with the same cross-process lock, holding it through the save swap or edit and through the game-start decision. Recheck running state after acquiring it.
@ -0,0 +207,4 @@
/// The sync folder's save was made from base, or from a save made from it (base null: this device never agreed with it). A
/// History as long as one is kept may have lost base: unknown, never taken as a conflict against an unchanged device
static bool Follows(SaveSyncManifest m, string? @base) =>
@base != null && m.History is { } h && (h.Contains(@base) || h.Count >= Kept);
Member

L2 (blocking): A full history is treated as proof of ancestry even when it contains no common save.

When: A device last agreed on save A, then published its own branch B while a cloud client lagged. If a different branch reaches 1,000 history entries without containing B, that device's unchanged local B is treated as behind and Pull imports the other branch without a conflict prompt.

Do: Treat missing ancestry as unknown and ask about the conflict, or use an ancestry representation that can prove the relationship beyond the history cap.

**L2** (blocking): A full history is treated as proof of ancestry even when it contains no common save. *When:* A device last agreed on save A, then published its own branch B while a cloud client lagged. If a different branch reaches 1,000 history entries without containing B, that device's unchanged local B is treated as behind and Pull imports the other branch without a conflict prompt. **Do:** Treat missing ancestry as unknown and ask about the conflict, or use an ancestry representation that can prove the relationship beyond the history cap.
Owner

Please re-implement this on the new launcher!

Ideally, this should be in the settings under game with other paths. It should be a checkbox like 'customize saves directory' which when enable, can select new location, similar to the other paths. It should move the saves to new dir too like other stuff

Please re-implement this on the new launcher! Ideally, this should be in the settings under game with other paths. It should be a checkbox like 'customize saves directory' which when enable, can select new location, similar to the other paths. It should move the saves to new dir too like other stuff
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Compile and test (pull_request) Blocked by required conditions
This pull request has changes conflicting with the target branch.
  • App/App.axaml.cs
  • App/LauncherService.cs
  • App/MainWindow.axaml
  • App/MainWindow.axaml.cs
  • App/PadInput.cs
  • App/Program.cs
  • App/ViewModels/BuildStepViewModel.cs
  • App/ViewModels/HomeViewModel.cs
  • App/ViewModels/HookshotImportViewModel.cs
  • App/ViewModels/SavesViewModel.cs
  • App/Views/SavesView.axaml
  • App/Views/Views.cs
  • Core/CoreJson.cs
  • Core/CrashReports.cs
  • Core/LauncherSettings.cs
  • Core/PerfReports.cs
  • Core/SaveArchive.cs
  • Core/SaveBackups.cs
  • README.md
  • docs/controller.md
  • docs/saves.md
  • tests/launcher_app/Program.cs
  • tests/launcher_core/PadChecks.cs
  • tests/launcher_core/Program.cs
  • tests/update_handoff/SaveSync.cs
  • tools/screenshots/Program.cs
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/save-sync:dukenheimer-feat/save-sync'
git switch 'dukenheimer-feat/save-sync'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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
MagicBeanDev/LongshotLauncher!275
No description provided.