Skip to content

fix(runtime-cef): replace assert_eq! in CefRuntime::init with diagnostic panic#13

Open
senamakel wants to merge 1 commit into
feat/openhuman-audio-handlerfrom
fix/cef-init-clear-error
Open

fix(runtime-cef): replace assert_eq! in CefRuntime::init with diagnostic panic#13
senamakel wants to merge 1 commit into
feat/openhuman-audio-handlerfrom
fix/cef-init-clear-error

Conversation

@senamakel
Copy link
Copy Markdown
Member

Summary

Replaces the bare assert_eq!(cef::initialize(...), 1) in
CefRuntime::init (crates/tauri-runtime-cef/src/lib.rs:2071) with a
logged panic! that carries the actual return code and cache_path.

The previous assert produces an opaque assertion left == right panic
when CEF browser-process init fails — no info about the cause, useless
for triage.

Context

In production this fired ~442 times across 8 days on Win10/11 + Linux
(Sentry OPENHUMAN-TAURI-A). The dominant trigger is a second app
instance whose cache lock is still held by the primary. The consuming
app is fixing that side by registering tauri-plugin-single-instance
before Builder::build(). This PR is defense in depth: any remaining
init failure (corrupt cache, missing helpers, sandbox denied, …) now
produces an actionable Sentry event instead of a bare assert.

Test plan

  • N/A: vendored crate in downstream consumer; smoke-tested via the
    consumer's cargo check on the bumped submodule pointer.

…tic panic

The previous `assert_eq!(cef::initialize(...), 1)` produces an opaque
`assertion left == right` panic when CEF browser-process init fails,
with no information about the cause. In production this hides the
dominant trigger — a second app instance whose cache lock is still
held by the primary — behind a useless stack trace
(Sentry OPENHUMAN-TAURI-A, 442 events across Win10/11 + Linux, all
releases).

Replace the assert with a logged panic that includes the actual return
code and `cache_path`. The expectation is that callers register
`tauri-plugin-single-instance` before `Builder::build()` to remove the
primary cause; this change ensures any remaining init failure produces
an actionable Sentry event instead of a bare assertion.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d4337579-5f65-4e89-a344-7945a25701ef

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

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.

1 participant