Add depot fetching progress indicator - #1775
Conversation
📝 WalkthroughWalkthroughSteamService tracks depot-key preparation for each download attempt, updates status as keys resolve, rejects stale callbacks, and clears preparation when chunks begin or jobs are removed. Two localized strings describe preparation progress. ChangesDepot key preparation flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant downloadApp
participant SteamService
participant DepotKeyCallback
participant DownloadInfo
downloadApp->>SteamService: initialize depot-key preparation
DepotKeyCallback->>SteamService: report resolved depot
SteamService->>DownloadInfo: update preparation status
DownloadInfo->>SteamService: report first chunk
SteamService->>DownloadInfo: clear preparation status
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/src/main/java/app/gamenative/service/SteamService.kt`:
- Around line 376-395: The depot preparation status update in
noteDepotKeyResolved can race with clearDepotKeyPrep and restore a stale message
after cleanup. Synchronize noteDepotKeyResolved and clearDepotKeyPrep using the
same lock, and before writing the status re-check that depotKeyPrep[appId] still
references the captured active DepotKeyPrep; only update when it remains active,
while preserving cleanup’s status clear.
- Line 407: Update the job-removal flow in SteamService to call
clearDepotKeyPrep(appId) instead of forgetDepotKeyPrep(appId), ensuring
DownloadInfo.statusMessage is cleared before the job is removed. Preserve the
surrounding cancellation, failure, and completion behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ebad5087-cf5b-4178-bfbf-cd3fa8d35c58
📒 Files selected for processing (2)
app/src/main/java/app/gamenative/service/SteamService.ktapp/src/main/res/values/strings.xml
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Description
I had attempted to download Borderlands 2 across multiple app versions but it always appeared stuck at 0% so I decided to investigate. When debugging, I found that this game has 61 depots which is significantly more than most games (which have 1-3 according to Google).
I revised the progress indicator to show progress when fetching depots now to avoid this situation and prevent false reports of games not downloading - some may truly just have dozens like this one.
Recording
Before
before.mp4
After
after.mp4
Type of Change
Checklist
#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.CONTRIBUTING.md.Summary by cubic
Show progress while fetching depot keys before downloads start, fixing the “stuck at 0%” state for games with many depots (e.g., Borderlands 2). The UI now shows “Preparing download…” and “Preparing depots (X/Y)” until data begins downloading.
DepotKeyCallback, seeded a prep message, and tracked per-app depot-key progress as keys resolve.DownloadInfoso late callbacks can’t re-post or overwrite.Written for commit 6d997da. Summary will update on new commits.
Summary by CodeRabbit
New Features
Bug Fixes