Skip to content

Conversation

@Brendonovich
Copy link
Contributor

@Brendonovich Brendonovich commented Sep 23, 2025

minidump starts a second process of the app to observe crashes, which are then reported to sentry

Summary by CodeRabbit

  • New Features

    • Improved desktop crash reporting with native minidump capture and enhanced error tracking across app and crash-reporter processes.
    • Persistent daily-rotating application logs written to a local logs directory.
  • Chores

    • Updated Sentry dependency to v0.42.0.
    • Added Tauri Sentry plugin to the desktop app.
    • CI: broadened debug-symbol upload to macOS and added Windows support.

@vercel
Copy link
Contributor

vercel bot commented Sep 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
cap-web Ready Ready Preview Comment Sep 23, 2025 9:59am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

Walkthrough

Bumps workspace sentry 0.34.0→0.42.0, adds tauri-plugin-sentry = "0.5.0" to the Tauri app, initializes Sentry then tauri-plugin-sentry minidump, adds daily rolling file tracing logs, and updates CI to upload debug symbols for macOS and Windows.

Changes

Cohort / File(s) Summary
Workspace dependency
Cargo.toml
Update workspace sentry version from 0.34.0 to 0.42.0, preserving features ["anyhow","backtrace","debug-images"].
Tauri app dependencies
apps/desktop/src-tauri/Cargo.toml
Add tauri-plugin-sentry = "0.5.0" to [dependencies].
App init & logging
apps/desktop/src-tauri/src/main.rs
Initialize sentry::init returning a client, call tauri_plugin_sentry::minidump::init(&sentry_client), retain guards; compute/create logs dir, add daily-rotating file appender via tracing_appender, non-blocking writer and guard, and register a file fmt layer (ANSI disabled).
CI workflow
.github/workflows/publish.yml
Change macOS condition to runner.os == 'macOS', update macOS upload path to target/.../Cap.dSYM; add Windows step if: runner.os == 'Windows' to upload target/${{ matrix.settings.target }}/release/cap_desktop.pdb.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant App as Tauri App (main.rs)
    participant FS as FileSystem
    participant Tracing as tracing_appender
    participant Sentry as sentry::init
    participant Plugin as tauri_plugin_sentry::minidump::init

    rect rgb(250,250,240)
    note over App,FS: Logging setup
    App->>FS: compute logs_dir & create dir
    App->>Tracing: create daily rotating appender -> non_blocking writer + guard
    Tracing-->>App: writer, guard
    App->>App: register tracing layers (fmt with writer)
    end

    rect rgb(235,245,255)
    note over App,Sentry: Sentry initialization
    App->>Sentry: init(DSN, ClientOptions)
    Sentry-->>App: sentry_client, guard
    end

    rect rgb(240,255,240)
    note over App,Plugin: Minidump initialization (new)
    App->>Plugin: init(&sentry_client)
    Plugin-->>App: minidump_guard
    end

    App-->>App: retain sentry_client, sentry guards, and tracing guard for process lifetime
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A hop, a bump, the versions climb anew,
I nibble bugs and tuck a minidump too.
Logs roll daily, tidy in their lair,
Sentry listens closely—I'm on guard with care. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "add minidump via sentry-tauri" clearly and concisely states the main change: integrating minidump support using the Tauri Sentry plugin, which matches the code and dependency updates in Cargo.toml, the new initialization in apps/desktop/src-tauri/src/main.rs, and the CI changes for uploading debug symbols.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sentry-minidump

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73967a5 and 17c80bd.

📒 Files selected for processing (2)
  • .github/workflows/publish.yml (1 hunks)
  • apps/desktop/src-tauri/src/main.rs (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/publish.yml
  • apps/desktop/src-tauri/src/main.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Clippy
  • GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
  • GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
  • GitHub Check: Analyze (rust)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (3)
apps/desktop/src-tauri/src/main.rs (3)

7-9: Remove unnecessary crate imports (will trip clippy).

These bring crates into scope without using the use bindings; you already refer to them fully qualified.

Apply this diff:

-use dirs;
-use tracing_appender;

56-70: Avoid unwrap() for log dirs; provide a safe fallback.

dirs::home_dir() and data_local_dir() can be None. Use fallbacks to avoid panics.

Apply this diff:

-    let logs_dir = {
-        #[cfg(target_os = "macos")]
-        let path = dirs::home_dir()
-            .unwrap()
-            .join("Library/Logs")
-            .join("so.cap.desktop");
-
-        #[cfg(not(target_os = "macos"))]
-        let path = dirs::data_local_dir()
-            .unwrap()
-            .join("so.cap.desktop")
-            .join("logs");
-
-        path
-    };
+    let logs_dir = {
+        #[cfg(target_os = "macos")]
+        {
+            dirs::home_dir()
+                .map(|p| p.join("Library/Logs").join("so.cap.desktop"))
+                .unwrap_or_else(|| std::env::temp_dir().join("so.cap.desktop"))
+        }
+        #[cfg(not(target_os = "macos"))]
+        {
+            dirs::data_local_dir()
+                .map(|p| p.join("so.cap.desktop").join("logs"))
+                .unwrap_or_else(|| std::env::temp_dir().join("so.cap.desktop").join("logs"))
+        }
+    };

77-81: Don’t mem::forget the non-blocking writer guard.

Leaking the guard risks losing buffered logs. Keep it bound and let it drop at process end.

Apply this diff:

-    let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender);
-    // Keep the guard alive for the duration of the program
-    std::mem::forget(_guard);
+    let (non_blocking, _nb_guard) = tracing_appender::non_blocking(file_appender);
+    // Keep _nb_guard in scope; it will flush on Drop
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf5cbf4 and 73967a5.

📒 Files selected for processing (2)
  • .github/workflows/publish.yml (1 hunks)
  • apps/desktop/src-tauri/src/main.rs (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx,rs}

📄 CodeRabbit inference engine (CLAUDE.md)

Do not add inline, block, or docstring comments in any language; code must be self-explanatory

Files:

  • apps/desktop/src-tauri/src/main.rs
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Format Rust code using rustfmt and ensure all Rust code passes workspace-level clippy lints.
Rust modules should be named with snake_case, and crate directories should be in kebab-case.

Files:

  • apps/desktop/src-tauri/src/main.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
  • GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
  • GitHub Check: Analyze (rust)
🔇 Additional comments (1)
apps/desktop/src-tauri/src/main.rs (1)

46-50: Verified: minidump::init expects &sentry::ClientInitGuard — current call is correct.
tauri-plugin-sentry v0.5.0 (re-exporting sentry-rust-minidump) takes a &sentry::ClientInitGuard (the guard returned by sentry::init), not an Arc, so init(&sentry_client) is correct.

@Brendonovich Brendonovich merged commit 83bbacb into main Sep 23, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants