Skip to content

Chat sample: private direct messages #100

@pathosDev

Description

@pathosDev

Followup from the chat sample (`examples/chat/`). Currently only
multi-user public rooms exist. This issue tracks adding 1:1 direct
messages.

Approach

  • New entity type `DmChannelActor` keyed on canonical pair-ID
    (`min(a,b)|max(a,b)`), sharded the same way `ChatRoomActor` is.
  • Persistent the same way (SQLite journal, separate `persistenceId`).
  • New protocol frames:
    ```ts
    type ClientMessage = ... | { type: 'dm-send'; to: string; text: string };
    type ServerMessage = ... | { type: 'dm-message'; from: string; to: string; text: string; ts: number };
    ```
  • Each `UserSessionActor` subscribes to `dm.` topic
    on login; broadcasts of DMs target both participants' topics.

UI

  • New "Direct messages" section in the rooms-panel listing currently
    online users.
  • Click a user → opens DM chat window in the center pane.

Out of scope

  • Group DMs (3+ participants). Cover via the existing room mechanism
    with private rooms (see #USER-ROOMS).

Source: `examples/chat/` README → "Out of scope" section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: lowNice-to-have / niche / demand-driven

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions