Desktop exit logs omit the shutdown request source
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
- 65/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- macos, rust, tauri
- Lĩnh vực
- desktop, observability
Hướng nghiên cứu
Bắt đầu từ điểm vào dùng chung request_app_exit(AppHandle) và truy vết các caller của app-menu, applicationShouldTerminate:, tray, Tauri ExitRequested, SIGTERM và SIGHUP. Chạy cargo test -p cap-desktop --test exit_shutdown đồng thời kiểm tra các nhật ký shutdown hiện có. Hoàn tất có nghĩa là mọi lần thử thoát một cách bình thường, bao gồm cả các yêu cầu bị chặn, đều ghi lại một nguồn có cấu trúc ổn định trước các kiểm tra admission.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Desktop shutdown diagnostics do not identify what requested the exit. This makes an orderly _exit(0) look like a spontaneous crash when Cap disappears during recording or editor work, and it prevents the application log from distinguishing an app-menu Quit, native macOS/Dock termination, tray Quit, runtime exit, or Unix signal.
I hit this while investigating repeated user-visible "crashes" on the signed Cap 0.5.9 macOS build. There were no Cap .ips, .crash, .hang, or .spin reports in macOS DiagnosticReports. A controlled Quit during an active Studio recording produced FeedLocked warnings for both microphone and camera cleanup, then the 0.5.9 process performed its hard exit with status 0. The Cap log showed cleanup, but only the macOS unified log established that the exit originated from a Quit AppleEvent/menu action.
The recording/finalization admission guards merged in #2172 address the unsafe 0.5.9 lifecycle behavior on current main. This issue tracks the remaining observability gap: future reports still cannot be classified from Cap's own logs.
Reproduction
- Launch the macOS desktop app.
- Start a Studio recording or open an editor.
- Request Quit from the app menu, Dock/native termination path, tray, runtime,
SIGTERM, orSIGHUP. - Inspect
cap-desktop.log.
Actual result
Direct shutdown paths converge on request_app_exit without recording the caller. The log can show cleanup and a clean hard exit, but not why shutdown began. On 0.5.9, an admitted Quit during recording additionally reached feed cleanup while the microphone and camera were still locked.
Expected result
Every graceful exit attempt should log a stable, structured source before admission checks. Blocked requests should also retain that source in the same diagnostic sequence. A report can then be classified from Cap logs alone without depending on short-lived macOS unified-log history.
Root cause
The app menu, macOS applicationShouldTerminate:, tray menu, Tauri ExitRequested, SIGTERM, and SIGHUP paths all call the same source-less request_app_exit(AppHandle) function. The runtime event has a generic pre-log and the signals have separate text logs, but the native/app/tray callers have no equivalent attribution and no common field.
Environment and evidence
- Cap: signed stable 0.5.9; compared against
mainat82519d2a42a2336545a9f30133330f4d5e10ad0a(0.6.0 source) - macOS: 26.6.2, Apple silicon M4, 24 GB RAM
- Audio: Focusrite Scarlett Solo USB, negotiated at 192 kHz stereo and resampled by Cap to 48 kHz mono
- Camera: Logitech BRIO, 1280x720 at 30 fps
- Controlled 0.5.9 Quit evidence: microphone and camera cleanup returned
FeedLocked; process exit was voluntary status 0; no Apple crash report was created - Current-main lifecycle verification:
cargo test -p cap-desktop --test exit_shutdownpasses all 21 tests, including recording/finalization refusal and Quit-during-Stop coverage - Local current-main app bundle built, installed, and launched successfully
No recording names, local media paths, account data, or service URLs are included here.
Proposed fix
Thread a typed exit source through request_app_exit and emit it as structured tracing data at the start of every graceful exit attempt.
- Ngôn ngữ chính
- Rust
- Star
- 22.5k
- Fork
- 1.9k
- Merge trung bình
- 7 giờ 43 phút
- Pull request đã merge (30 ngày)
- 80
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 CapSoftware/Cap
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
CapSoftware/Cap#2305 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CapSoftware/Cap#1714 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
CapSoftware/Cap#2340 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
CapSoftware/Cap#2339 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
CapSoftware/Cap#2329 · 2 bình luận ·
Tất cả issue của CapSoftware/Cap
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
bug core
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW Đang mởfuzz
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ClickHouse/ClickHouse#122114 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
linebender/vello_svg#90 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100