windows-reactor gaps and hardening - #4682
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens windows-reactor based on external field reports by adding a central fault boundary for WinUI callback panics, filling functional gaps (window icon support), and fixing/reproducing correctness issues with new regression tests and samples.
Changes:
- Add a reactor-owned fault boundary (
fault) and publicApp::on_faulthook to catch/report panics from WinUI callback entry points. - Add window icon support via
App::icon+ un-stubIAppWindow::SetIcon, plus a sample. - Fix nested component re-render pruning and add regressions; add
animated_canvasunmount teardown + regression.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/crates/windows-reactor.md | Documents the new fault/panic contract and field-reported friction items. |
| crates/tools/reactor/src/base.txt | Un-stubs IAppWindow::SetIcon in the bindings filter. |
| crates/tests/libs/reactor/tests/nested_state_rerender.rs | Regression test for nested component re-rendering from its own use_state. |
| crates/tests/libs/reactor_selftest/src/bindings.rs | Regenerated selftest bindings to include IAppWindow::SetIcon. |
| crates/tests/libs/canvas/src/lib.rs | Regression asserting animated_canvas installs an unmount teardown. |
| crates/tests/libs/canvas/Cargo.toml | Enables windows-canvas reactor feature and adds windows-reactor for the new test. |
| crates/samples/reactor/samples/examples/on_fault.rs | New sample demonstrating App::on_fault behavior. |
| crates/samples/reactor/samples/examples/icon.rs | New sample demonstrating App::icon. |
| crates/libs/reactor/src/reconciler.rs | Seeds forced re-render for state-dirty nested components to avoid pruning bugs. |
| crates/libs/reactor/src/lib.rs | Adds fault module and exports Fault. |
| crates/libs/reactor/src/interaction.rs | Wraps callback invocation with the fault boundary. |
| crates/libs/reactor/src/host.rs | Applies icon/presenter/backdrop best-effort work via fault reporting inside activate. |
| crates/libs/reactor/src/hooks.rs | Wraps timers/rendering callbacks with the fault boundary. |
| crates/libs/reactor/src/fault.rs | New central fault boundary (catch, render_scope, report) + unit tests. |
| crates/libs/reactor/src/engine.rs | Wraps render pass in fault::render_scope. |
| crates/libs/reactor/src/bindings.rs | Regenerated reactor bindings to include IAppWindow::SetIcon. |
| crates/libs/reactor/src/backend/winui/mod.rs | Consolidates best-effort COM drops/logging through diag::{warn,dropped}. |
| crates/libs/reactor/src/backend/winui/diag.rs | Introduces unified debug-only warn/drop helpers with #[track_caller]. |
| crates/libs/reactor/src/app.rs | Adds App::icon + file validation and App::on_fault handler installation. |
| crates/libs/canvas/src/reactor.rs | Adds animated_canvas unmount teardown to break a reference cycle and stop leaks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some improvements based on https://github.com/damyanp/netmon-rs/blob/main/reactor-notes.md