Fix: GOG chunk URL broken when CDN token is in query string#1215
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughRefactors GOG URL construction: adds Changes
Sequence Diagram(s)(omitted — changes are refactor/utility-focused and do not introduce a new multi-component runtime control flow requiring visualization) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/src/main/java/app/gamenative/service/gog/GOGDownloadManager.kt`:
- Around line 745-755: The function buildGen1MainBinUrl currently returns a
relative "/main.bin" when passed null/empty which later gets fed into
Request.Builder().url() and triggers an OkHttp IllegalArgumentException; change
buildGen1MainBinUrl to fail fast by requiring a non-null, non-blank baseUrl (use
require/baseUrl?.trim().isNotEmpty()) and throw a clear IllegalArgumentException
with an explanatory message if missing, so callers (the code that calls
buildGen1MainBinUrl before Request.Builder().url()) receive an immediate,
descriptive failure instead of a deferred runtime error.
🪄 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
Run ID: cca4296f-ae7e-4768-b9f9-acf79aa0e5ba
📒 Files selected for processing (4)
app/src/main/java/app/gamenative/service/gog/GOGDownloadManager.ktapp/src/main/java/app/gamenative/service/gog/api/GOGManifestParser.ktapp/src/test/java/app/gamenative/service/gog/GOGDownloadManagerTest.ktapp/src/test/java/app/gamenative/service/gog/api/GOGManifestParserTest.kt
7c7a211 to
34a8e96
Compare
Description
A fix applied in another project, but the fix applies to us as well. Tested and still works.
Recording
The412Banner/BannerHub@4f3c515
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
Fix GOG chunk and Gen1 main.bin URLs when CDN tokens are in the query string. We now insert paths before the query to preserve Akamai
__token__params and avoid 403s.GOGManifestParserfor both global and per-product maps.buildGen1MainBinUrlinGOGDownloadManagerto place/main.binbefore query; trims input and throws if URL is missing.GOGManifestParserand add tests for tokenized URLs andmain.binedge cases.Written for commit 34a8e96. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests