Skip to content

Fix Linux Steam game detection#19825

Open
halgari wants to merge 1 commit intomasterfrom
fix-linux-detection
Open

Fix Linux Steam game detection#19825
halgari wants to merge 1 commit intomasterfrom
fix-linux-detection

Conversation

@halgari
Copy link
Copy Markdown
Contributor

@halgari halgari commented Feb 12, 2026

Summary

Vortex cannot discover Steam games on Linux due to two independent bugs:

  1. Steam path detection uses getVortexPath("home") instead of os.homedir() — prevents the Steam base directory from being found at all.
  2. GameStoreHelper.find() regression — a strictNullChecks refactor broke all queryArgs-based game discovery.

Bug 1: Wrong home directory from Electron initialization dependency

getLinuxSteamPaths() called getVortexPath("home") to build paths like ~/.local/share/Steam. Under the hood, getVortexPath("home") resolves through a multi-layered system that depends on Electron's initialization state:

  • Main process: delegates to electron.app.getPath("home") via cachedAppPath(), which requires the Electron app object to be fully initialized. If app is undefined (e.g. the call happens before Electron is ready, or in a forked child process that didn't receive the env vars), it falls back to os.tmpdir() — returning something like /tmp instead of the user's home directory.
  • Renderer process: reads from ApplicationData.vortexPaths, a cache populated over IPC from the main process during startup. If the cache hasn't been populated yet (timing-dependent), the path lookup can fail or return stale/incorrect values.
  • Forked child processes: read from environment variables (ELECTRON_HOME) that are set when the process is spawned. If game discovery runs in a context where these env vars weren't propagated, the home path is wrong.

All of these indirections are unnecessary here. The home directory is a simple OS-level fact — os.homedir() returns it directly from Node.js without any dependency on Electron's lifecycle, IPC state, or environment variable propagation. The fix replaces getVortexPath("home") with os.homedir().

Bug 2: GameStoreHelper.find() always discards results

Commit f4d9f06 (a strictNullChecks refactor) changed the guard in find() from:

if (result !== undefined)

to:

if (result && result.gameStoreId !== undefined && result.priority !== undefined)

The result.priority !== undefined check is the problem: priority is not a field that game stores set on their entries — it's assigned inside this very block. The old code checked result !== undefined, then assigned priority. The refactored code checks priority as a precondition, which always fails, so every result is silently discarded. This breaks all queryArgs-based discovery (the primary mechanism game extensions use to find installed games).

The fix restores the guard to if (result !== undefined) and keeps strict null safety by wrapping the mStoresDict lookup in a ternary to handle entries where gameStoreId is undefined (registry entries).

Test plan

  • yarn build compiles without errors in modified files
  • yarn test — no test regressions from these changes
  • Manual: start Vortex on Linux, verify Steam games are automatically discovered

Two bugs prevented Vortex from discovering Steam games on Linux:

1. steamPaths.ts used getVortexPath("home") which depends on Electron
   initialization and can return the wrong path. Replaced with
   os.homedir() which always returns the correct home directory.

2. GameStoreHelper.find() had a regression from a strictNullChecks
   refactor that required result.priority to be defined as a
   precondition. Since no game store sets priority on entries, the
   condition always evaluated to false, breaking all queryArgs-based
   discovery. Restored the guard to just check result !== undefined
   and assign priority unconditionally inside the block.
@halgari
Copy link
Copy Markdown
Contributor Author

halgari commented Feb 12, 2026

not sure if the os.homedir() thing is really what we want, considering the IPC separation, but this fixes the game detection for linux which has been broken since the IPC changes went in.

Copy link
Copy Markdown

@Empty-Ghost Empty-Ghost left a comment

Choose a reason for hiding this comment

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

Fix Linux game detection

@github-actions
Copy link
Copy Markdown

This PR has conflicts. You need to rebase the PR before it can be merged.

@github-actions
Copy link
Copy Markdown

This PR has been marked as stale due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants