Open
Conversation
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.
Contributor
Author
|
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. |
|
This PR has conflicts. You need to rebase the PR before it can be merged. |
|
This PR has been marked as stale due to inactivity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Vortex cannot discover Steam games on Linux due to two independent bugs:
getVortexPath("home")instead ofos.homedir()— prevents the Steam base directory from being found at all.GameStoreHelper.find()regression — astrictNullChecksrefactor broke allqueryArgs-based game discovery.Bug 1: Wrong home directory from Electron initialization dependency
getLinuxSteamPaths()calledgetVortexPath("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:electron.app.getPath("home")viacachedAppPath(), which requires the Electronappobject to be fully initialized. Ifappisundefined(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 toos.tmpdir()— returning something like/tmpinstead of the user's home directory.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.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 replacesgetVortexPath("home")withos.homedir().Bug 2:
GameStoreHelper.find()always discards resultsCommit f4d9f06 (a
strictNullChecksrefactor) changed the guard infind()from:to:
The
result.priority !== undefinedcheck is the problem:priorityis not a field that game stores set on their entries — it's assigned inside this very block. The old code checkedresult !== undefined, then assigned priority. The refactored code checks priority as a precondition, which always fails, so every result is silently discarded. This breaks allqueryArgs-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 themStoresDictlookup in a ternary to handle entries wheregameStoreIdis undefined (registry entries).Test plan
yarn buildcompiles without errors in modified filesyarn test— no test regressions from these changes