Skip to content

Fix/steam cloud sync - #722

Merged
maxjivi05 merged 2 commits into
WinNative-Emu:mainfrom
maxjivi05:fix/steam-cloud-sync
Sep 3, 2026
Merged

Fix/steam cloud sync#722
maxjivi05 merged 2 commits into
WinNative-Emu:mainfrom
maxjivi05:fix/steam-cloud-sync

Conversation

@maxjivi05

Copy link
Copy Markdown
Contributor

No description provided.

The agent's cloud sync ran a second RunAutoCloudOnApp* attempt whose wait
loop never terminated: IsAppSyncInProgress latches true after that call, and
the loop's only early exit was "synchronized" or "disabled". On Monster
Hunter Rise attempt 1 settled in 533ms at changeslocally, then attempt 2
burned the full 90000ms launch cap and, on the way out, the full 60000ms
exit budget - about 150 seconds per session with no transfer happening.

Three changes:

- The wait loop now also breaks when GetRemoteStorageSyncState holds a
  definite non-inprogress verdict for 1500ms while IsAppSyncInProgress is
  still set, so the latch can no longer pin the loop to its cap.
- changeslocally is terminal for a launch sync: local saves are ahead of the
  cloud, there is nothing to download, and the exit sync is what uploads
  them. The attempt cap now also applies on exit, which previously retried
  until the budget ran out.
- EvaluateRemoteStorageSyncState runs before every attempt rather than only
  the first, so a retry acts on fresh state instead of a stale verdict.

Turning cloud saves off had no effect on the agent. steamCloudHandledByAgent
skips the app-side sync unconditionally and WN_STEAM_AGENT_CLOUD, which the
launcher already reads to gate both its launch and exit sync, was never set
by the app. It is now set to 0 when the shortcut has cloud saves disabled or
is in offline mode, so neither side syncs on open or close.

Device-measured on a OnePlus CPH2749, app 1446780: launch sync 90003ms ->
694ms and 518ms over two runs.
Monster Hunter Rise stores its cloud saves through the ISteamRemoteStorage
API, so the files live in userdata/<id>/1446780/remote and the app declares
no AutoCloud file patterns. RunAutoCloudOnAppExit only walks AutoCloud
patterns, so for this class of game it returns in ~300ms having enumerated
nothing: no network traffic, remotecache.vdf byte-identical before and
after, and the sync state parked at changeslocally launch after launch. The
launch-side call is equally inert; the correct-looking "changeslocally"
verdict comes from EvaluateRemoteStorageSyncState reading the local
remotecache, not from any transfer.

The result was that saves were never backed up. On the test device the
cloud copy was nine days behind local and stayed there across every run.

The launcher now says so explicitly when an exit sync ends with local ahead
of the cloud, and the app runs its own upload when it sees that. That path
is HTTP and does not need the wine prefix, but it does need the app-side
Steam client, which is handed off to the in-prefix client for the whole
session. Placing the fallback in the clean-shutdown handshake missed the
release by one millisecond and failed every time, so it runs after
sanitizeSteamStateForNextSession releases the hand-off and waits up to 20s
for the client to come back before uploading.

Device-verified on a OnePlus CPH2749, app 1446780: ChangeNumber 0 -> 139,
both pending files moved to syncstate 1 with remotetime advanced from
2026-08-24 21:22 to the current save at 2026-09-02 23:59:50, SHAs unchanged,
and 16 steamcloud storage requests where previous runs made none.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@maxjivi05
maxjivi05 merged commit 8ed4ff8 into WinNative-Emu:main Sep 3, 2026
0 of 4 checks passed
@maxjivi05
maxjivi05 deleted the fix/steam-cloud-sync branch September 3, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant