Skip to content

Test control: the token stays out of games and tools the launcher starts - #571

Merged
elripalda merged 1 commit into
elripalda:mainfrom
Xarishark:fix/test-control-token-env
Nov 25, 2026
Merged

elripalda merged 1 commit into
elripalda:mainfrom
Xarishark:fix/test-control-token-env

Conversation

@Xarishark

Copy link
Copy Markdown
Collaborator

Follows up #548.

The launcher read RECOMPLAUNCHER_TEST_CONTROL (and _PORT) but left them in its own environment, so every game, recomp or mod from GitHub, emulator, setup script, ReShade tool and its own restart inherited the token, and could drive the launcher over MCP with it (run JS in the window, install/uninstall, screenshots).

  • test_control::take_from_env() runs first thing in run(), before any thread starts: it reads both variables once, keeps them in a OnceLock, and removes them from the environment. test_control::start uses the kept values.
  • The Steam-clean restart on Linux (sysenv::prepare_start, which execs the launcher again) is still the start the tester asked for, so it gets the two variables back explicitly on that one command. An update's restart doesn't: it's a new build, and test control stays off until it's started with the token again.
  • docs/TEST-CONTROL.md says so in "Keep in mind".

Tests (test_control): the variables are gone from std::env after the take and the kept values still give the right wanted; a program started after the take doesn't see the token (cmd /C set / env); the own restart gets the kept token and nothing else.

The launcher read RECOMPLAUNCHER_TEST_CONTROL and its port but left them
in its environment, so every game, recomp, emulator, setup script and
tool it started inherited the token. Both are now read once at the very
start, kept in the launcher, and taken out of its environment. Only the
launcher's own start again without Steam's libraries (Linux) gets them
back; an update's restart doesn't.
@Xarishark Xarishark self-assigned this Nov 25, 2026
@Xarishark
Xarishark marked this pull request as ready for review November 25, 2026 12:22
@elripalda
elripalda merged commit b2d1f38 into elripalda:main Nov 25, 2026
6 checks passed
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.

2 participants