Skip to content

docs(web): SAFETY comment for DerivedStateActor#445

Merged
intendednull merged 1 commit into
auto-fix/batch-2026-04-27-181113from
auto-fix/issue-435-safety-comment
Apr 27, 2026
Merged

docs(web): SAFETY comment for DerivedStateActor#445
intendednull merged 1 commit into
auto-fix/batch-2026-04-27-181113from
auto-fix/issue-435-safety-comment

Conversation

@intendednull
Copy link
Copy Markdown
Owner

Why

Audit AUD-1: bare unsafe impl Send on DerivedStateActor no SAFETY comment. Future maintainer no clue if impl redundant or load-bearing.

Fix

  • Add // SAFETY: block above unsafe impl Send in crates/web/src/state_bridge.rs.
  • Comment walks four fields: StateRef<T> Send via params, Arc<dyn Fn ... + Send + Sync> Send via trait-object bound, Arc<Mutex<Option<U>>> Send via params, SendWrapper<WriteSignal<U>> unconditional Send w/ runtime cross-thread panic.
  • Calls out single-WASM-thread invariant (Leptos browser-only) so SendWrapper runtime check never trips.
  • Link back to spec follow-up F2 (docs/specs/2026-04-26-state-management-model-design.md) since cached Mutex tracked there.
  • Did NOT delete impl — kept as guard so future !Send field forces reaffirmation.

Verify

  • cargo fmt clean
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo test --workspace all pass
  • cargo check --target wasm32-unknown-unknown clean for all WASM crates

Refs #435


Generated by Claude Code

Document soundness of `unsafe impl Send` per audit AUD-1 (#435):
field-by-field Send rationale, single-WASM-thread invariant for
SendWrapper, and link back to spec follow-up F2.

Refs #435
@intendednull intendednull merged commit 4135366 into auto-fix/batch-2026-04-27-181113 Apr 27, 2026
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