Skip to content

Channel struct missing pinned_messages: HashSet<EventHash> field #61

@intendednull

Description

@intendednull

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions