Skip to main content
Harly uses Server-Sent Events (SSE) for browser updates because the flow is server-to-client. PostgreSQL remains the source of truth; the stream is a delivery optimization and can be replayed or reconciled.

Client flow

The browser should invalidate the smallest affected query rather than call a global router.refresh() after every event.

Reliability model

  • PostgreSQL is authoritative.
  • Durable domain events support automation, audit, and webhooks.
  • Realtime events carry event type, event version, schema version, workspace, sequence, and a compact payload.
  • The client reconnects automatically and performs a focused reconciliation.
  • Ephemeral UI events such as candidate.viewed do not need durable domain retention.
Never treat receipt of an SSE event as proof that a mutation committed. Read the affected record from the authenticated API after invalidation.

Event types

The SSE stream emits these event types: Ephemeral events like candidate.viewed are not retained in the domain event outbox and cannot be replayed.

Production guidance

1

One stream per tab

Keep one EventSource connection per browser tab. Multiple streams per workspace waste connections and produce duplicate events.
2

Invalidate precisely

Invalidate the smallest affected query rather than calling a global router.refresh() after every event.
3

Monitor health

Track SSE p95 latency and reconnect rates. A broken stream must not block a database mutation or background job.
4

Handle reconnection

After a reconnect, reconcile visible queries by re-fetching the data that changed during the disconnection window.

Troubleshooting

Next steps

Webhooks

Send events to external systems with signed deliveries.

Automations

Trigger internal workflows on domain events.

API overview

Authentication, rate limits, and response formats.