Streaming: what happens, told as it happens

Mastodon's streaming API: /api/v1/streaming as a WebSocket (streams
subscribed in the URL or by message) and /api/v1/streaming/{stream} as
server-sent events, with health and the URL advertised. The user stream
tells posts reaching the persona's home (not those an exclusive list keeps
apart, which its list stream tells), notifications, edits and deletions;
public, hashtag and list streams tell what belongs in them. An in-process
hub carries ids only; each connection maps a post or a notification for its
own persona as it sends it, so nothing it may not see, or whose author it
blocked or muted, goes out. A deletion reaches only the streams that showed
the post. The token comes as access_token, header or WebSocket protocol.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-05 04:04:08 +02:00
1 parent b274ce1268
commit 9268968fd4
14 files changed
+650 -30

No files matched your search

+8 -1
View File
@@ -470,6 +470,10 @@ The first refactor commit is a pure move with namespaces only. Logic changes fol
- **Scheduled statuses:** `scheduled_at` on posting, `scheduled_statuses` (P9).
- **Tags:** `tags/:name` with history, follow and unfollow, `followed_tags` (P9).
- **Trends and directory:** `trends/tags`, `trends/statuses`, `trends/links`, `directory` (P9).
- **Streaming:** `/api/v1/streaming` (WebSocket, subscribe and unsubscribe messages) and `/api/v1/streaming/{stream}`
(server-sent events): `user`, `user:notification`, `public`, `public:local`, `public:remote`, `hashtag`,
`hashtag:local`, `list`; events `update`, `notification`, `status.update`, `delete`; `health`. Advertised as
`urls.streaming`.
- **Stubs:** `custom_emojis`, announcements, suggestions, preferences.
- **Mapping:**
- Avatar, ForeignAvatar and Group all map to Account (`group: true` for groups). `acct` uses a WebFinger-verified
@@ -634,7 +638,10 @@ it, raw where it doesn't.
- a relay client for both relay styles;
- instance actor discovery (FEP-d556, FEP-2677);
- `implements` (FEP-844e).
- **Mastodon API:** streaming WebSocket, Web Push, grouped notifications. Then advertise an honest version.
- **Mastodon API:** ~~streaming WebSocket~~ (done 2026-10-05: `/api/v1/streaming` as a WebSocket and as server-sent
events, user, notification, public, hashtag and list streams, each event mapped for its persona; a deletion reaches
only the streams that showed the post), Web Push (gated: outbound traffic to push services), grouped notifications.
Then advertise an honest version.
- **Backfill:** an author's outbox after following them.
- **Long tail:**
- MFM rendering data;