Uh oh!
There was an error while loading. Please reload this page.
Fix/steam cloud sync - #722
Merged
Merged
Conversation
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.
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.