macOS: open can start a second copy of an app that was just launched
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
- 45/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ệ
- typescript
- Lĩnh vực
- cli, mobile-dev
Hướng nghiên cứu
Start by tracing the macOS open command and its helper that selects an NSRunningApplication; the issue does not name their file paths or tests. Reproduce the quick relaunch case, then inspect how the command launches by bundle ID and how the helper chooses a process. Done means an already running app can be targeted without starting a duplicate or confusing two copies with the same bundle ID.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
On macOS, agent-device open <bundleId> --platform macos can start a second copy of an app that is already running, then drive whichever copy NSRunningApplication.runningApplications(withBundleIdentifier:).first returns.
Repro
- Launch an app yourself (e.g. a dev build started by a supervisor process with custom launch arguments).
- Within ~0.5–0.75 s, run
agent-device open <bundleId> --platform macos. psshows two processes for the bundle: the original (with its arguments) and a new one with ppid 1 and no arguments.
Cause: open runs /usr/bin/open [-g] -b <bundleId> without first checking for a running instance. A process that was just spawned isn't listed by LaunchServices yet (lsappinfo lists it ~0.5–0.75 s later), so open -b launches a new copy. If you wait until lsappinfo find bundleid=<id> pid=<pid> returns the process, open attaches and only one copy remains (3/3 runs).
Proposal
- Before calling
open -b, check for a running instance of the bundle (NSRunningApplication orlsappinfo) and attach to it instead of launching. - Offer an explicit target, e.g.
--pid <pid>or an app path, so a caller that launched the app itself can attach to that exact process. - In the macOS helper, resolve the target by pid when one is known, rather than
.first, so two copies with the same bundle id can't be confused.
Context: Stim's stim macos launches dev builds this way; we're adding a LaunchServices wait on our side, but the attach behavior would make open safe for any caller.
- Ngôn ngữ chính
- TypeScript
- Star
- 5k
- Fork
- 334
- Merge trung bình
- 12 giờ 29 phút
- Pull request đã merge (30 ngày)
- 663
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 callstack/agent-device
-
bug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
callstack/agent-device#3627 · 1 bình luận ·
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 68/100
callstack/agent-device#1869 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A session lost to a daemon takeover ("Replacing daemon … unreachable") answers the next request with AMBIGUOUS_MATCH when two simulators are bootedCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug ready-for-agent
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
callstack/agent-device#3674 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement ready-for-agent
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
callstack/agent-device#3531 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
iOS: an Xcode too old for the host macOS surfaces as 'Runner did not accept connection'Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
callstack/agent-device#3449 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của callstack/agent-device
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/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 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug category:ai category:devices effort:s
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
LanternOps/breeze#8943 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
area:reliability difficulty:easy help wanted points:100 Stellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Divinity-Labs/Lens#341 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày