Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Desktop exit logs omit the shutdown request source

Abierto
#2,201 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
65/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
macos, rust, tauri

Línea de trabajo

Comienza en el punto de entrada compartido request_app_exit(AppHandle) y sigue los llamadores de app-menu, applicationShouldTerminate:, tray, Tauri ExitRequested, SIGTERM y SIGHUP. Ejecuta cargo test -p cap-desktop --test exit_shutdown mientras compruebas los logs de shutdown existentes. La tarea está terminada cuando cada intento de salida ordenada, incluidas las solicitudes bloqueadas, registra una fuente estructurada estable antes de las comprobaciones de admisión.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
  1. Launch the macOS desktop app.
  2. Start a Studio recording or open an editor.
  3. Request Quit from the app menu, Dock/native termination path, tray, runtime, SIGTERM, or SIGHUP.
  4. 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 main at 82519d2a42a2336545a9f30133330f4d5e10ad0a (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_shutdown passes 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.

Lenguaje dominante
Rust
Estrellas
22.5k
Forks
1.9k
Merge medio
7 h 43 min
PR fusionados (30 d)
80

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de CapSoftware/Cap

Todos los issues de CapSoftware/Cap

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.