Skip to content

Fall back to English depots for unavailable languages#1659

Open
VinceBT wants to merge 1 commit into
utkarshdalal:masterfrom
VinceBT:fix/depot-language-fallback
Open

Fall back to English depots for unavailable languages#1659
VinceBT wants to merge 1 commit into
utkarshdalal:masterfrom
VinceBT:fix/depot-language-fallback

Conversation

@VinceBT

@VinceBT VinceBT commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Some owned games show 0 B download and disk size and can't be installed. Example: appId 1150690 on a French container.

The cause is depot language selection. That game ships one full Windows depot per language (English, Simplified Chinese, Japanese, Korean) with no language-neutral build. filterForDownloadableDepots drops every non-DLC depot whose language doesn't match the container language, and none of them is French, so all depots are filtered out: zero downloadable depots, hence 0 B and no install.

Fix: added SteamUtils.effectiveDepotLanguage, which picks the language to filter by from what the app actually ships an installable depot in — the requested one, else English (Steam's default), else any language it offers. Depot resolution filters by that effective language instead of the raw container language.

The helper lives in SteamUtils so both the base game (resolveDownloadableDepots) and each DLC (getDownloadableDepots) resolve their own language independently, so we don't pull wrong-language files for a DLC. It only pools tagged base-game depots when choosing the fallback, so an owned in-app DLC can't steer the base game's language, and untagged (neutral) depots pass the language filter unconditionally and are ignored by the pool, so they resolve regardless. Games that already offer the requested language are unaffected.

Result: the French container now resolves the English depot for 1150690 and shows a real size / can install. Any game shipping per-language depots without the user's language is fixed the same way, base game and DLC alike.

Recording

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

Fall back to English (or another shipped language) when a game’s container language isn’t available in Windows depots, so base games and DLC show real sizes and install instead of 0 B.

  • Bug Fixes
    • Resolve an effective depot language via SteamUtils.effectiveDepotLanguage from installable base‑game Windows depots: requested → english → first available; neutral depots don’t steer; DLC depots don’t steer the base game; arch ignored; exclude SteamChina; encrypted manifests count only with a Steam‑unlocked branch; respect licensing and DLC ownership.
    • Apply that language in eligibility and filtering for the main app and each DLC, fixing titles missing the container language; added unit tests for priorities and edge cases.

Written for commit 7168105. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved depot download language selection by deriving the most effective, currently installable base-game language rather than relying solely on the preferred language.
    • Enhanced fallback behavior to choose a suitable language when the preferred option isn’t available or eligible for download.
    • Updated DLC depot filtering so each DLC uses its own effective language, improving compatibility and reducing missing or failed DLC downloads.

@VinceBT VinceBT requested a review from utkarshdalal as a code owner July 2, 2026 12:15
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

SteamService now derives an effective depot language from installable depots and applies it to base app filtering and indirect DLC depot selection.

Changes

Steam depot language resolution

Layer / File(s) Summary
Effective language selection
app/src/main/java/app/gamenative/utils/SteamUtils.kt
Adds effectiveDepotLanguage(...) with installability checks, eligible-language collection, and fallback selection.
Filtering with effective language
app/src/main/java/app/gamenative/service/SteamService.kt
resolveDownloadableDepots(...) now uses the derived language for eligibility gating and final downloadable depot filtering.
DLC language resolution
app/src/main/java/app/gamenative/service/SteamService.kt
getDownloadableDepots(appId, preferredLanguage) now derives a base language and per-DLC languages before filtering depot candidates.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • utkarshdalal/GameNative#1053 — Directly overlaps with SteamService.getDownloadableDepots(...) language selection for depot resolution.

Possibly related PRs

Suggested reviewers: utkarshdalal

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly summarizes the fallback-to-English depot language fix.
Description check ✅ Passed The description covers the change, rationale, type, and checklist; only the recording section remains empty.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread app/src/main/java/app/gamenative/service/SteamService.kt Outdated
@VinceBT VinceBT force-pushed the fix/depot-language-fallback branch from 227fe31 to e7c780c Compare July 2, 2026 12:21
@VinceBT VinceBT changed the title Fall back to English depots when the container language has none Fall back to English depots for unavailable languages Jul 2, 2026
@VinceBT VinceBT force-pushed the fix/depot-language-fallback branch from e7c780c to 4561a39 Compare July 2, 2026 12:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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 948-960: The fallback language selection in
resolveDownloadableDepots is too broad because availableLanguages is built from
every depot, including DLC-only depots, which can cause effectiveLanguage to
favor a language the base game does not actually support. Restrict the language
pool to base-game depots only (for example, depots with dlcAppId ==
INVALID_APP_ID) before applying the preferred-language/English fallback. Keep
the language choice deterministic by avoiding reliance on LinkedHashSet
iteration order when selecting the fallback language, so
filterForDownloadableDepots sees the base game’s real language set.
🪄 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: 01a8a64f-ae98-4b6b-81a6-3252436155df

📥 Commits

Reviewing files that changed from the base of the PR and between e7c780c and 4561a39.

📒 Files selected for processing (1)
  • app/src/main/java/app/gamenative/service/SteamService.kt

Comment thread app/src/main/java/app/gamenative/service/SteamService.kt Outdated
@VinceBT VinceBT force-pushed the fix/depot-language-fallback branch from 4561a39 to 527efc1 Compare July 2, 2026 12:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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 1055-1063: The DLC language resolution in effectiveDepotLanguage()
is still hardcoded to base-game depots, so indirect DLCs can miss all eligible
languages. Update the language selection path used from the indirectDlcApps loop
in SteamService to accept a configurable depot scope or predicate, and pass a
DLC-aware filter that includes depots tagged with the DLC’s app id from
generateSteamApp() instead of only INVALID_APP_ID. Keep the existing base-game
behavior intact by reusing the same effectiveDepotLanguage() logic with
different scope inputs for base apps versus DLC apps.
🪄 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: 86956d15-70a0-488e-affc-77b814a040ab

📥 Commits

Reviewing files that changed from the base of the PR and between 4561a39 and 527efc1.

📒 Files selected for processing (1)
  • app/src/main/java/app/gamenative/service/SteamService.kt

Comment thread app/src/main/java/app/gamenative/service/SteamService.kt
@VinceBT VinceBT force-pushed the fix/depot-language-fallback branch from 527efc1 to ac55c45 Compare July 2, 2026 12:52

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 938-942: The depot selection flow is not consistently passing
hasSteamUnlockedBranch, so unlocked encrypted depots can be considered by
effectiveDepotLanguage() but later excluded by eligibleDepots() and the final
filter. Update the depot eligibility path in SteamService.kt to thread the same
hasSteamUnlockedBranch value through eligibleDepots(...) and the final filter
call that uses filterForDownloadableDepots(...), keeping the branch-unlocked
behavior consistent across both selection and downloadability checks.

In `@app/src/main/java/app/gamenative/utils/SteamUtils.kt`:
- Around line 119-126: `DepotInfo.installableInItsLanguage()` is allowing realms
that `filterForDownloadableDepots()` will later reject, which can make
`effectiveDepotLanguage` pick an unusable language. Update the
language-availability check in `SteamUtils.kt` so it mirrors the final realm
gate used by `filterForDownloadableDepots()`, and ensure the same
SteamChina-only restriction is applied before a depot is considered selectable.
🪄 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: 1c1fc39f-6b4e-4cae-a72d-1f1d581fae92

📥 Commits

Reviewing files that changed from the base of the PR and between 527efc1 and ac55c45.

📒 Files selected for processing (2)
  • app/src/main/java/app/gamenative/service/SteamService.kt
  • app/src/main/java/app/gamenative/utils/SteamUtils.kt

Comment thread app/src/main/java/app/gamenative/service/SteamService.kt
Comment thread app/src/main/java/app/gamenative/utils/SteamUtils.kt Outdated
@VinceBT VinceBT force-pushed the fix/depot-language-fallback branch 3 times, most recently from abf2a7c to b0f4214 Compare July 2, 2026 13:09
@utkarshdalal

Copy link
Copy Markdown
Owner

Please add back the PR template, it should not be overwritten

@VinceBT

VinceBT commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Updated @utkarshdalal

@VinceBT VinceBT force-pushed the fix/depot-language-fallback branch from b0f4214 to 7168105 Compare July 7, 2026 21:47
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.

3 participants