daemon install: LaunchAgent points at the versioned node binary, so every Node upgrade adds a new background item
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- macos, node.js, typescript
研究方向
Start with dist/ports/service-manager.js and its plistFor function, then trace how nodePath is supplied from daemon/service-main.js and cli/index.js. Compare the suggested stable launcher and /usr/bin/env approaches, including how each handles Node upgrades and LaunchAgent registration. Done means the installed agent can use the current Node after an upgrade without creating repeated background items; the issue leaves macOS behavior and the preferred approach open.
由索引模型根據 Issue 內容生成。
描述
Request: #2008
Problem
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/shthat execs the current node andmain.js) and pointProgramArgumentsat 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.
Facts
Measured 2026-12-01 on macOS 26.6.1 (arm64) with a throwaway LaunchAgent, each step bootout, replace the file, bootstrap, read from the log of backgroundtaskmanagementd. "New item" means macOS gave the item a new id, marked not notified. In the first run macOS posted an alert for the first three new items; after that it logged should post advisory=false and posted none, so later rows rest on the item's id, not on a visible alert.
| What the plist runs | What changed | macOS |
|---|---|---|
| Node signed by the Node.js Foundation | Node path and PATH |
same item |
| Node signed ad hoc (as Homebrew's is) | Node path and PATH, another build |
new item |
| unsigned launcher script | plist rewritten, same contents | new item, alert posted |
| unsigned launcher script | launcher contents only, then the folder is read again | new item |
| unsigned launcher script | nothing, folder read again | same item |
/usr/bin/env <node> <main.js> |
Node path and PATH, signed or ad hoc Node |
same item |
signed Node to /usr/bin/env, or either to a launcher |
the program | new item, once |
The request's case (signed Node, new path) did not produce a new item on 26.6.1. macOS 27.2 is not measured.
Open questions
- Does macOS 27.2 behave the same?
- What does the plist run:
/usr/bin/env <node> <main.js>, or a launcher whose contents never change?
Written by an agent.
- 主要語言
- TypeScript
- 星號
- 730
- 分支
- 44
- 平均合併
- 15 小時 28 分鐘
- 30 天內合併 PR
- 387
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
callstackincubator/simlock 的其他 Issue
-
bug:new
難度 2/5 1-3 小時 新手友好度 73/100
callstackincubator/simlock#2088 ·
維護者通常 1 天內回覆
-
bug:new
難度 2/5 1-3 小時 新手友好度 64/100
callstackincubator/simlock#2080 · 1 則留言 ·
維護者通常 1 天內回覆
-
task:ready
難度 4/5 3-5 天 新手友好度 52/100
callstackincubator/simlock#2079 ·
維護者通常 1 天內回覆
-
platform:ios task:ready
難度 5/5 一週以上 新手友好度 18/100
callstackincubator/simlock#2078 ·
維護者通常 1 天內回覆
-
iOS copy: keep the app database at the copy's own UDID可能已有人在做 @V3RON 今天認領。 未關閉platform:ios task:ready
callstackincubator/simlock#2077 · 2 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 callstackincubator/simlock 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
enhancement good first issue
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 80/100
earendil-works/gondolin#222 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 78/100
endora-commerce/endora-commerce#2203 ·
維護者通常 1 天內回覆
-
enhancement priority:medium ready-for-human
難度 2/5 1-3 小時 新手友好度 66/100
wondermoney/wondermoney#1079 ·
維護者通常 1 天內回覆