daemon install: LaunchAgent points at the versioned node binary, so every Node upgrade adds a new background item

Aperta
#2,008 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
devtools

Direzione di ricerca

Start with dist/ports/service-manager.js at plistFor, then read daemon/service-main.js and cli/index.js to trace how nodePath reaches the LaunchAgent. Compare the stable launcher and explicit command suggestions against the reported upgrade behavior. Done when the installed agent keeps a stable program path across Node upgrades and the worker uses the current Node; the payload names no tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

request:new

simlock 0.9.0, macOS 27.2, Node from a version manager (mise; nvm/fnm/asdf behave the same)

simlock daemon install writes com.callstack.simlock.worker.plist with process.execPath and a script under that Node version's global node_modules:

<key>ProgramArguments</key>
<array>
  <string>~/.local/share/mise/installs/node/24.22.3/bin/node</string>
  <string>~/.local/share/mise/installs/node/24.22.3/lib/node_modules/simlock/dist/daemon/main.js</string>
</array>

(from dist/ports/service-manager.js, plistFor, with nodePath: process.execPath in daemon/service-main.js and cli/index.js)

Why it matters on an unattended Mac: macOS Background Task Management tracks a LaunchAgent by its program path. When a Node upgrade (and the reinstall that follows) rewrites the plist with a new path, macOS registers it as a new item and posts a persistent "Background Items Added" alert. We confirmed that rewriting a plist under the same label with a different program path posts a new alert. On a shared agent Mac nobody is at the screen, so these alerts pile up. Until the reinstall, the worker also keeps running on the old Node.

Suggestion: make the program path stable, for example:

  • install a small launcher at a fixed path (for instance $SIMLOCK_HOME/bin/simlock-worker, a #!/bin/sh that execs the current node and main.js) and point ProgramArguments at it; a rewritten launcher doesn't change the registered item; or
  • accept an explicit command (simlock daemon install --node /path/to/stable/node, or an env var) so users can point it at a version-manager shim or a stable symlink.

Happy to test a fix.

Lingua principale
TypeScript
Stelle
730
Fork
44
Merge medio
15h 28m
PR unite (30g)
387

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di callstackincubator/simlock

Tutte le issue di callstackincubator/simlock

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.