daemon install: LaunchAgent points at the versioned node binary, so every Node upgrade adds a new background item
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- macos, node.js, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 730
- Fork
- 44
- Merge trung bình
- 15 giờ 28 phút
- Pull request đã merge (30 ngày)
- 387
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của callstackincubator/simlock
-
bug:new
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
callstackincubator/simlock#2088 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug:new
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
callstackincubator/simlock#2080 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
task:ready
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
callstackincubator/simlock#2079 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
platform:ios task:ready
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
callstackincubator/simlock#2078 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
iOS copy: keep the app database at the copy's own UDIDCó thể đã có người làm @V3RON đã nhận hôm nay. Đang mởplatform:ios task:ready
callstackincubator/simlock#2077 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của callstackincubator/simlock
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
earendil-works/gondolin#222 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
endora-commerce/endora-commerce#2203 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement priority:medium ready-for-human
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
wondermoney/wondermoney#1079 ·
Maintainer thường phản hồi trong vòng 1 ngày