Commit: 2f26d91 · Finding: ARCH-09
Problem
Two entirely different ServerState types live in the same dependency graph:
willow_state::ServerState at crates/state/src/server.rs:33 — authoritative event-sourced projection (server_id, channels, roles, members, permissions, messages, profiles, …).
willow_web::state::ServerState at crates/web/src/state.rs:140 — Leptos-signal sidecar for UI (servers, active_server_id, …).
Both are reachable from willow_web. Any use willow_state::ServerState; use willow_web::state::ServerState; pair is a compile error or a subtle shadowing bug; IDE go-to-definition behaves unpredictably. The spec explicitly names willow_state::ServerState as the single source of truth, so the UI-side reuse of that name undermines the mental model.
Same issue applies to web::state::ChatState and VoiceState, which also collide with client::state::ChatState and client::state_actors::VoiceState.
Fix
Rename the web-side types:
ServerState → ServerSignals (or ServerViewSignals)
ChatState → ChatSignals
VoiceState → VoiceSignals
Obvious? Moderate — mechanical find-and-replace at the boundary; will be auto-PR'd.
Commit:
2f26d91· Finding:ARCH-09Problem
Two entirely different
ServerStatetypes live in the same dependency graph:willow_state::ServerStateatcrates/state/src/server.rs:33— authoritative event-sourced projection (server_id, channels, roles, members, permissions, messages, profiles, …).willow_web::state::ServerStateatcrates/web/src/state.rs:140— Leptos-signal sidecar for UI (servers, active_server_id, …).Both are reachable from
willow_web. Anyuse willow_state::ServerState; use willow_web::state::ServerState;pair is a compile error or a subtle shadowing bug; IDE go-to-definition behaves unpredictably. The spec explicitly nameswillow_state::ServerStateas the single source of truth, so the UI-side reuse of that name undermines the mental model.Same issue applies to
web::state::ChatStateandVoiceState, which also collide withclient::state::ChatStateandclient::state_actors::VoiceState.Fix
Rename the web-side types:
ServerState→ServerSignals(orServerViewSignals)ChatState→ChatSignalsVoiceState→VoiceSignalsObvious? Moderate — mechanical find-and-replace at the boundary; will be auto-PR'd.