docs(federation): document username on profile_update + new presence_update relay + stub backfill
- federation.md §10: extend FederationProfileUpdatePayload with username, document receiver fallback. Add Presence Sync sub-section: event shape, sender call sites, outbox-only (no mutation log) policy, peer-lifecycle hooks, flap recovery semantics. Add Stub Username Backfill sub-section + new /api/federation/users/by-home-id endpoint. - activity-presence.md: resolve drift — line 147 previously claimed S2S presence_update relays existed but the code didn't ship them. Now points to federation.md §10 which describes the actually-implemented mechanism. Connect/ Disconnect Flow updated to reflect collectProfileBroadcastTargetIds recipient set + S2S queueing. - social.md / websocket.md: presence_update recipient column now reflects friends + DM + space co-members (matches user_updated), plus federated stub presence sourced via S2S.
This commit is contained in:
@@ -12,7 +12,7 @@ Source: `packages/server/src/ws/handler.ts`, `packages/server/src/ws/events.ts`
|
||||
2. Client sends `{ type: 'auth', token: '<jwt>' }` within 10 seconds
|
||||
3. Server validates token (rejects deleted users, tokens issued before `passwordChangedAt`)
|
||||
4. Server responds with `ready` event containing full client state
|
||||
5. Server updates user status to `online`, broadcasts `presence_update` to all user's spaces
|
||||
5. Server updates user status to `online`, broadcasts `presence_update` to friends + DM co-members + space co-members (via `collectProfileBroadcastTargetIds`); for native users, also queues a S2S `presence_update` relay to all active peers
|
||||
6. Heartbeat: server pings every 30s (RFC 6455 ping frames), dead connections detected after ~65s
|
||||
|
||||
---
|
||||
@@ -123,7 +123,7 @@ Source: `packages/server/src/ws/handler.ts`, `packages/server/src/ws/events.ts`
|
||||
### Presence & Activity
|
||||
| type | fields | scope |
|
||||
|------|--------|-------|
|
||||
| `presence_update` | userId, status, activities? | space (all members) |
|
||||
| `presence_update` | userId, status, activities? | friends + DM co-members + space co-members of the user (via `collectProfileBroadcastTargetIds`), plus self for multi-tab sync. For federated stubs, the local instance receives status via S2S `presence_update` relay from the home (see `federation.md` §10 — Presence Sync) and re-broadcasts to the same recipient set. |
|
||||
| `user_updated` | user | user |
|
||||
|
||||
### Space / Channel Management
|
||||
|
||||
Reference in New Issue
Block a user