Skip to content

Fix environment variables missing during undo_cmd in prep cmds#202

Merged
Nonary merged 3 commits intoNonary:masterfrom
Daviex:fix-env-vars-during-undo-cmd
Apr 17, 2026
Merged

Fix environment variables missing during undo_cmd in prep cmds#202
Nonary merged 3 commits intoNonary:masterfrom
Daviex:fix-env-vars-during-undo-cmd

Conversation

@Daviex
Copy link
Copy Markdown

@Daviex Daviex commented Apr 15, 2026

Hello Nonary,
using ApolloProfileManager, I found out it wasn't working because when the stream goes into terminating because the update apps function was replacing entirely the envs, losing access to app and client uuid, and couldn't save into the profile the edits done by the current client.

This fix aims to fix this problem by checking that currently are no app running before overwriting the environments. I tried it locally and now ApolloProfileManager works flawlessly.

Also added 2 logs with correct wording for it.

Thanks for your work.

Copilot AI and others added 3 commits April 15, 2026 13:37
fix: replace copy-pasted "Playnite URI launch started" logs with correct messages
Only replace the stored environment in update_apps if no app is currently running (_app_id <= 0). Previously _env was always replaced when updating apps, but execute() writes stream-specific variables (APOLLO_APP_UUID, APOLLO_CLIENT_UUID, SUNSHINE_CLIENT_*, etc.) that must survive until terminate() runs undo/prep commands. The change keeps the scoped lock and moves the env assignment behind a conditional to preserve those variables while an app is active.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes loss of stream/session-specific environment variables during config refresh while an app is running, which could break undo prep commands (and tools like ApolloProfileManager) during termination.

Changes:

  • Replaces two incorrect log messages with warnings that match the actual failure conditions (trailing $ in env-var parsing, SHA256 computation failure fallback).
  • Updates proc_t::update_apps() to avoid overwriting _env while an app is active, preserving stream-specific variables until termination completes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Nonary Nonary merged commit 484baca into Nonary:master Apr 17, 2026
4 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.

4 participants