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

オープン
#2,008 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
node.js, typescript
領域
devtools

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
730
フォーク
44
平均マージ
15時間 28分
マージ済み PR(30日)
387

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstackincubator/simlock のほかの issue

callstackincubator/simlock の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。