Skip to content

fix: Prevent global state smashing#18

Merged
dawsontoth merged 1 commit into
mainfrom
prevent-global-state-smashing
Jun 17, 2026
Merged

fix: Prevent global state smashing#18
dawsontoth merged 1 commit into
mainfrom
prevent-global-state-smashing

Conversation

@dawsontoth

@dawsontoth dawsontoth commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

So I ran into this where I had run the integration tests on a clean machine, and then later in the day, I could not for the life of me figure out why I couldn't launch harper on an unrelated app! Claude helped me figure out the culprit -- I had aimed Harper at some ephemeral spot which had gotten cleaned up.

This helps our integration tests set the home dir so we don't touch the user's stuff!

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request isolates Harper's home directory into a throwaway directory (dataRootDir) by setting the HOME and USERPROFILE environment variables. The reviewer pointed out that spreading options?.env after these variables could unintentionally overwrite them and defeat the isolation fix, and suggested spreading options?.env first to ensure the isolated paths take precedence.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/harperLifecycle.ts Outdated
@dawsontoth dawsontoth force-pushed the prevent-global-state-smashing branch from 5e83125 to 5c8a3cb Compare June 16, 2026 17:12
@dawsontoth dawsontoth merged commit 5ff580e into main Jun 17, 2026
6 checks passed
@dawsontoth dawsontoth deleted the prevent-global-state-smashing branch June 17, 2026 17:52
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