Skip to content

Skip commitFileUpload for files Steam Cloud already has - #1958

Open
jeremybernstein wants to merge 1 commit into
utkarshdalal:masterfrom
jeremybernstein:jb/fix-steam-cloud-dedup-commit
Open

jeremybernstein wants to merge 1 commit into
utkarshdalal:masterfrom
jeremybernstein:jb/fix-steam-cloud-dedup-commit

Conversation

@jeremybernstein

@jeremybernstein jeremybernstein commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Description

When Steam already holds a file's exact contents, beginFileUpload returns no blocks to upload, but we still called commitFileUpload. Steam rejects that commit (nothing pending), producing an error for every unchanged file in the batch.

Fix: skip the commit for those files. They stay in the batch manifest and still count as uploaded.

Tests: SteamAutoCloudTest.

Split out of #1570 (HTML5 runtime). It stands on its own: the bug reproduces on master and this PR has no dependency on #1570.

Recording

n/a (infrastructure)

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Skips commitFileUpload for files Steam Cloud already has by SHA, so unchanged files no longer fail the upload with a rejected commit error. They still count as uploaded because they remain in the batch manifest.

Bug Fixes

  • When beginFileUpload returns an empty blockRequests list, the cloud already has that exact blob; skip the commit instead of getting file_committed=false.
  • Adds a regression test for SHA-deduped uploads, covering change-number advancement and the skipped commit.

Written for commit 31560ca. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Improved cloud uploads for files whose content already exists remotely.
    • These files are now recognized as uploaded without unnecessary commit processing.
    • Files requiring block uploads continue through the standard upload workflow.
  • Tests

    • Added coverage for deduplicated uploads and change-number advancement.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: eb2ca126-18f6-4be6-ac5d-902b909816a5

📥 Commits

Reviewing files that changed from the base of the PR and between b341917 and 31560ca.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: de4418aa-1352-495f-9291-26f27ba3ff0c

📥 Commits

Reviewing files that changed from the base of the PR and between 88a60ef and b341917.

📒 Files selected for processing (2)
  • app/src/main/java/app/gamenative/service/SteamAutoCloud.kt
  • app/src/test/java/app/gamenative/service/SteamAutoCloudTest.kt

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The upload flow now treats empty blockRequests as existing Steam Cloud blobs. It counts those files as uploaded and skips commitFileUpload. A test verifies this path and the resulting change number.

Changes

Cloud upload deduplication

Layer / File(s) Summary
Deduplicated upload handling and validation
app/src/main/java/app/gamenative/service/SteamAutoCloud.kt, app/src/test/java/app/gamenative/service/SteamAutoCloudTest.kt
uploadFiles counts files with empty blockRequests as uploaded and skips commit processing. The test verifies zero commit calls, one completed batch, two uploaded files, and the updated change number.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: skipping commitFileUpload when Steam Cloud already has the file.
Description check ✅ Passed The description explains the bug, the fix, expected behavior, test coverage, and change classification. It also addresses the recording requirement as not applicable for infrastructure work, although …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jeremybernstein

Copy link
Copy Markdown
Contributor Author

Build failure most likely related to the prefs deadlock issue fixed on #1956, or the
Robolectric issue addressed on #1964.

Steam dedupes uploads by SHA. When beginFileUpload comes back with an empty
blockRequests list the cloud already holds that exact blob and no transfer
happens -- but we still called commitFileUpload for it, and the server answers
file_committed=false because it has nothing pending for that file in this
session. Log noise on every already-present file, with no effect on batch state.

The file remains part of the manifest declared in beginAppUploadBatch and carries
forward at completeAppUploadBatch, so it still counts toward filesUploaded.

Most visible on save sets with many small unchanged files, where nearly every
file is a dedup hit.
@jeremybernstein
jeremybernstein force-pushed the jb/fix-steam-cloud-dedup-commit branch from b341917 to 31560ca Compare September 21, 2026 06:44
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