Skip to content

windows-reactor make callback panics fatal - #4829

Merged
Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
r20
Aug 11, 2026
Merged

windows-reactor make callback panics fatal#4829
Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
r20

Conversation

@kennykerr

Copy link
Copy Markdown
Collaborator

No description provided.

@kennykerr
Kenny Kerr (kennykerr) merged commit 5f8e150 into master Aug 11, 2026
36 checks passed
Copilot stopped reviewing on behalf of Kenny Kerr (kennykerr) due to an error August 11, 2026 12:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates Reactor’s panic contract to treat panics as fatal at WinUI callback boundaries, removing the previous “catch/log/continue” recovery path and the public on_fault API.

Changes:

  • Replace panic-catching-and-continuing with abort_on_panic across WinUI callback entry points (render loop, event handlers, timers, activation, exit callback).
  • Remove the Fault type, App::on_fault API, and the on_fault sample.
  • Update docs and remove tests that asserted “post-commit effect panics keep the host usable”.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/crates/windows-reactor.md Updates documentation to reflect “panic is fatal / abort” contract and adjusts architecture checklist wording.
crates/tests/libs/reactor/tests/host_effects.rs Removes test that expected committed tree to remain usable after an effect panic.
crates/tests/libs/reactor/tests/backend_faults.rs Removes test that expected reconcile to remain usable after a post-commit effect panic.
crates/samples/reactor/samples/examples/on_fault.rs Removes the on_fault sample demonstrating recoverable vs fatal panics.
crates/libs/reactor/src/lib.rs Stops re-exporting Fault from the public API.
crates/libs/reactor/src/interaction.rs Switches event handler invocation to abort-on-panic behavior.
crates/libs/reactor/src/host.rs Switches activation callback handling to abort-on-panic behavior.
crates/libs/reactor/src/hooks.rs Switches timer/rendering callbacks to abort-on-panic behavior.
crates/libs/reactor/src/fault.rs Replaces the handler-based fault boundary with a simpler abort-on-panic boundary plus logging.
crates/libs/reactor/src/engine.rs Wraps render pass in abort-on-panic boundary instead of render-scoped catching.
crates/libs/reactor/src/app.rs Removes App::on_fault and changes callback execution to abort on panics.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 144 to 147
presenter: PresenterKind,
backdrop: Option<Backdrop>,
icon: Option<String>,
on_fault: Option<Box<dyn Fn(&Fault) + Send>>,
on_exit: Option<Box<dyn FnOnce() + Send>>,
Comment on lines +7 to 13
/// Run `f` and abort after reporting any panic under `context`.
pub(crate) fn abort_on_panic<T>(context: &'static str, f: impl FnOnce() -> T) -> T {
match std::panic::catch_unwind(AssertUnwindSafe(f)) {
Ok(value) => value,
Err(payload) => abort(context, &*payload),
}
}
Comment on lines +21 to 28
#[cold]
fn abort(context: &'static str, payload: &(dyn std::any::Any + Send)) -> ! {
let message = diagnostics::format_panic_payload(payload);
diagnostics::emit(&format!(
"windows_reactor: {context} panicked: {message}; aborting"
));
std::process::abort()
}
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