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.
Followup from the chat sample (`examples/chat/`). Currently only
multi-user public rooms exist. This issue tracks adding 1:1 direct
messages.
Approach
(`min(a,b)|max(a,b)`), sharded the same way `ChatRoomActor` is.
```ts
type ClientMessage = ... | { type: 'dm-send'; to: string; text: string };
type ServerMessage = ... | { type: 'dm-message'; from: string; to: string; text: string; ts: number };
```
on login; broadcasts of DMs target both participants' topics.
UI
online users.
Out of scope
with private rooms (see #USER-ROOMS).
Source: `examples/chat/` README → "Out of scope" section.