Repository navigation
fix(updater): accept the supervised serve's other spelling of its profile path - #34570
Conversation
…path Co-authored-by: Eotel <49769982+Eotel@users.noreply.github.com>
|
No actionable comments were generated in the recent review.
|
ELI5
On a Mac, the same folder can be written
Orcaororca. The backgroundorca serveservice names its profile folder one way and the app names it the other. So when an update was requested, the server decided it wasn't running under its supervisor and refused to update. Now it checks whether both names point at the same folder.What Changed
orca servestarted by the generated launchd service gets its update-handoff path from the CLI, which spells the profile~/Library/Application Support/orca. Electron's own profile path is~/Library/Application Support/Orca.getConfiguredHandoffPath()compared the two withpath.resolve()strings, so a case-insensitive volume's two spellings of one directory read as different. The server reportedmanual-service-update-requiredand refused the update before installing anything.It now requires the same handoff file name and compares the directories with the existing
isSameUserDataPath(realpath, which returns the on-disk casing). The startup profile guard and the rest of the serve launch flow already compare profiles this way. A path to a different profile, or to a directory that doesn't exist, is still rejected. The handoff is still written to Electron's own spelling of the path, so it lands in the same file the supervisor reads.This is @Eotel's fix from #34383, cherry-picked with their authorship kept. On top we added one test for the reported casing case; their test covers a symlink alias. This PR supersedes #34383. Thank you @Eotel for the report, the reproduction and the fix.
I also checked the other places this flow compares profile paths:
serve-service-unit.tsprofileSuffix) still compares strings. That's deliberate: changing it would rename already-installed services, so uninstall would miss them and a reinstall could start a second supervisor. The reported case doesn't hit it, because both sides use the CLI's spelling there.launch.ts, and the runtime source fence already useisSameUserDataPath.Why
It reuses the profile-identity check the serve flow already relies on, instead of adding a second notion of "same profile".
Linked Issue
Fixes #34382
Visual Proof
N/A: no UI change. The fix is in the server's supervisor check, and the tests reproduce it.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
serve-update-handoff.test.ts: the alias test and the casing test (which runs on case-insensitive volumes) both fail on main and pass here.Tests importing the changed module pass. The exception is
serve-update-handoff.app-environment.test.ts, which times out on this machine identically on unmodified main.pnpm tcand oxlint pass, and so does a local run of the PR static job. The Node 18 process-host smoke couldn't run because Node 18 isn't installed locally; this change doesn't touch process-host.Review
Reviewed by Codex and an independent reviewer: no findings at P0–P2.
Agent skill upstream boundary
Notes
macOS is where the bug shows; the handoff is only used with a macOS app bundle. Linux and Windows get the same identity check (Windows compares lowercased). No wire or compatibility changes.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)