Problem
The Channel struct in crates/channel/src/lib.rs:245-270 does not have a pinned_messages field. The DAG spec requires:
pub struct Channel {
// ...
pub pinned_messages: HashSet<EventHash>,
}
The current struct only has:
pub id: ChannelId,
pub name: String,
pub topic: Option<String>,
pub kind: ChannelKind,
pub created_at: DateTime<Utc>,
Note: willow-state has its own Channel type in crates/state/src/types.rs that correctly includes pinned_messages: HashSet<EventHash>. The issue is that the willow-channel crate's Channel type is out of sync with the state crate's version.
Impact
If any code uses the willow-channel::Channel type instead of willow-state::Channel, pinned message tracking is lost.
Suggested fix
Either:
- Add
pinned_messages: HashSet<EventHash> to willow-channel::Channel
- Consolidate to a single
Channel type (remove duplication between crates)
Location
crates/channel/src/lib.rs:245-270
- Compare with
crates/state/src/types.rs (correct version)
References
- Spec:
docs/specs/2026-04-01-per-author-merkle-dag-state-design.md (Section 2, ChatMessage Type Changes)
- Found during codebase audit against DAG spec
Problem
The
Channelstruct incrates/channel/src/lib.rs:245-270does not have apinned_messagesfield. The DAG spec requires:The current struct only has:
Note:
willow-statehas its ownChanneltype incrates/state/src/types.rsthat correctly includespinned_messages: HashSet<EventHash>. The issue is that thewillow-channelcrate'sChanneltype is out of sync with the state crate's version.Impact
If any code uses the
willow-channel::Channeltype instead ofwillow-state::Channel, pinned message tracking is lost.Suggested fix
Either:
pinned_messages: HashSet<EventHash>towillow-channel::ChannelChanneltype (remove duplication between crates)Location
crates/channel/src/lib.rs:245-270crates/state/src/types.rs(correct version)References
docs/specs/2026-04-01-per-author-merkle-dag-state-design.md(Section 2, ChatMessage Type Changes)