Conversation
…eMutex withRemoteUpdateMutex wrapped mutexPath in shq() before passing it to the inline Python script. Because updateMutex is already formatted by expandRemotePath() (which yields "$HOME"'/.hermes/...' or single-quoted paths), wrapping it in shq() again causes Python sys.argv[1] to receive literal quote characters. Python's os.makedirs and os.open then interpret the path as a relative path starting with ', resulting in a malformed directory named ' under the current working directory (e.g. $HOME/'/Users/.../.mutex'). In fact, two such paths were previously committed by accident into apps/desktop/. Remove the redundant shq() wrapper on mutexPath, add a regression test assertion preventing double-quoting, and remove the tracked accidental artifact files.
Duplicate of #96187 (earliest open PR with the same one-line fix; #99189 is a second competing copy). Same mechanism: One thing unique here worth keeping: this PR also deletes the two stray |
|
Closing in favor of #96187 (earliest open fix for the same double-quoting bug; #99189 is the other copy) — no need for a third duplicate in review queue. The one part unique to this PR — deleting the two stray tracked |
What does this PR do?
Fixes an issue where
withRemoteUpdateMutex()double-quotedupdateMutex, causing Python to interpret the path as a relative path with literal leading and trailing single quotes. This created a malformed directory named'under the user's home directory (e.g.$HOME/'/Users/.../.hermes/...).In addition, two such accidental directory artifacts previously tracked in
apps/desktop/(from running tests locally before this fix) have been removed.Root Cause
buildSpawnCommandpassesupdateMutex(produced byexpandRemotePath(), which is already shell-escaped as"$HOME"'/.hermes/...') intowithRemoteUpdateMutex(command, updateMutex). InwithRemoteUpdateMutex,mutexPathwas wrapped inshq(mutexPath)again when composingpython3 -c .... As a result, Python receivedsys.argv[1]enclosed in literal single quotes and treated it as a relative path rather than an absolute path.Related Issue
Fixes #
Type of Change
Changes Made
apps/desktop/electron/remote-lifecycle.ts: Removed redundantshq()wrapper aroundmutexPathinwithRemoteUpdateMutex.apps/desktop/electron/remote-lifecycle.test.ts: Added regression test assertion verifying thatupdateMutexpassed topython3 -cremains expandable without being re-quoted.apps/desktop/'/var/folders/...: Removed two accidentally committed artifact files created by local test runs before this fix.How to Test
apps/desktop:'is created in$HOMEor the working directory.Checklist
Code
fix(scope):, etc.)Documentation & Housekeeping