Skip to content

Reduced diff size#2

Open
utkarshdalal wants to merge 7 commits into
kiequoo:feat/steam-cloud-save-statusfrom
utkarshdalal:reduce-diff-1383
Open

Reduced diff size#2
utkarshdalal wants to merge 7 commits into
kiequoo:feat/steam-cloud-save-statusfrom
utkarshdalal:reduce-diff-1383

Conversation

@utkarshdalal
Copy link
Copy Markdown

Restructures SteamAutoCloud.kt so the diff against master is purely additive (no churn inside syncUserFiles()), making PR utkarshdalal#1383 easier to review.

What this does

  • Reverts the four "mechanical extraction" commits inside syncUserFiles() — the function body is now byte-identical to master, plus only:
    • the new onPhaseStarted: ((isUploading: Boolean) -> Unit)? = null parameter
    • 4 callsite invocations of the callback (download/upload phase transitions)
  • Re-adds the new helpers (CloudPathResolver, file-diff, local-scan, remote-change decision) and fetchSyncSnapshot / CloudSyncSnapshot as a clearly demarcated additive block at the end of the file.
  • Two internal helpers used only by fetchSyncSnapshot are renamed (snapshotFilesDiff, snapshotLocalUserFilesAsPrefixMap) so they don't collide with the inline lambdas of the same name still living inside syncUserFiles().

Resulting diff vs master

Metric Before After
SteamAutoCloud.kt diff vs master +306 / -286 +392 / -0

The whole change against master is now insertions only. syncUserFiles() shows a 5-line diff (1 param + 4 callback calls); the rest is a new section at the bottom of the file.

Tradeoff

Some logic that used to live inline in syncUserFiles() is now duplicated by the snapshot-only helpers at the bottom. That's intentional for review-ability — it keeps the existing sync path untouched and isolates the genuinely-new code path. Can be DRYed up later if desired.

Verification

External callers (SteamService.syncUserFiles, SteamService.fetchSyncSnapshot, CloudSyncSnapshot) keep identical signatures.

kiequoo and others added 7 commits May 15, 2026 11:06
Move the Steam Auto Cloud prefix and absolute-path resolution helpers out of syncUserFiles() so the same path mapping can be reused by the later status snapshot code.

This is intended to be a mechanical extraction only: the resolver keeps the existing rootoverride, addPath, embedded %GameInstall%, and remote file-list conversion behavior, and syncUserFiles() continues to call the same logic through the new resolver instance.
Move the local-vs-cached UserFileInfo diff calculation out of syncUserFiles() so both sync and status resolution can use one comparison function.

This is intended to be a mechanical extraction only: the created, deleted, modified, and changesExist calculations are unchanged, including the existing SHA comparison logging.
Move local save discovery out of syncUserFiles() so the later cloud status snapshot can inspect local files without duplicating scan behavior.

This is intended to be a mechanical extraction only: Windows UFS patterns, SteamUserData fallback scanning, prefix keys, timestamps, hashes, cloudRoot, and cloudPath are preserved.
Move the remote-newer conflict decision out of syncUserFiles() so the later status snapshot can classify pending download, upload, and conflict states with the same rules.

This is intended to be a mechanical extraction only: cached local-change detection remains timed in microsecAcPrepUserFiles, the cache rehydration shortcut still writes the same DB rows, and conflict timestamps/UFS version are preserved.
Expose a read-only snapshot path for the UI to resolve cloud status without starting a sync.

Add an optional phase callback to syncUserFiles() so SteamService can emit DOWNLOADING and UPLOADING status changes while preserving the existing sync flow.
Wire the Steam cloud snapshot and sync phase events into the library and app detail UI.

This keeps the SteamAutoCloud sync behavior in the earlier mechanical commits and limits this commit to status presentation, user actions, and service-level state tracking.
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.

2 participants