Skip to content

[C2S] Add Server-Sent Events (SSE) for real-time collection streaming #2946

@pfefferle

Description

@pfefferle

What

Implement the SWICG ActivityPub API SSE spec so C2S clients can subscribe to live updates on outbox and inbox collections instead of polling.

Key changes

  • SSE stream endpoint (GET /actors/{id}/{collection}/stream) with push OAuth scope requirement
  • Transient-based signal system for efficient polling — avoids unnecessary DB queries when no new items exist
  • access_token query parameter fallback in OAuth Server for EventSource clients (browser EventSource API cannot send Authorization headers)
  • eventStream property added to outbox and inbox collection responses
  • proxyEventStream added to actor endpoints (proxy returns 501 for now — wp_remote_get doesn't support streaming)
  • Event type mapping per spec: Create/Announce/Like → Add, Update → Update, Delete/Undo → Remove

Why

Enables C2S clients to receive real-time notifications of collection changes without polling, completing the push notification story for the C2S API.

Links

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions