diff --git a/crates/web/src/state_bridge.rs b/crates/web/src/state_bridge.rs index bd2a598e..1ddbfd1c 100644 --- a/crates/web/src/state_bridge.rs +++ b/crates/web/src/state_bridge.rs @@ -84,6 +84,17 @@ impl Han } } +// SAFETY: All four fields are Send under the `T: Send + Sync` and `U: Send + Sync` +// bounds on the impl: `StateRef` and `Arc>>` propagate Send from +// their parameters, `Arc U + Send + Sync>` is Send by its trait object +// bound, and `SendWrapper>` is unconditionally Send with a runtime +// panic on cross-thread access. The actor framework requires `Send` for spawning +// across its mailbox, but the actor only ever runs on a single WASM thread (Leptos +// is browser-only), so `SendWrapper`'s runtime check is never tripped. Manual impl +// guards against future field additions silently breaking auto-derive — any new +// `!Send` field must reaffirm or remove this assertion. Tracked alongside the +// `cached` Mutex follow-up in +// docs/specs/2026-04-26-state-management-model-design.md § Follow-up F2. unsafe impl Send for DerivedStateActor {