Skip to content

Stop opening two EventSource connections to the same stream #100

Description

@lucastononro

Problem. HomePage.connectSSE opens an EventSource on /api/sessions/{id}/stream (page.tsx:325), and useNotebookSSE independently opens a second EventSource on the identical endpoint (src/lib/notebook/useNotebookSSE.ts:50) whenever a notebook is mounted.

Why it matters. That doubles server fan-out and parses every event twice; the two also use different base URLs (see the hardcoded-URL issue), so they don't even fail the same way.

Suggested fix. Expose the single page-level stream via context and have the notebook subscribe to it rather than opening its own connection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priorityarea:frontendFrontend (Next.js)bugSomething is broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions