Skip to content

client(JournalClient.list): consume the server-streaming List response#51

Open
jshearer wants to merge 1 commit into
mainfrom
journals-list-stream-fold
Open

client(JournalClient.list): consume the server-streaming List response#51
jshearer wants to merge 1 commit into
mainfrom
journals-list-stream-fold

Conversation

@jshearer

Copy link
Copy Markdown
Contributor

The broker's List RPC is server-streaming and caps the number of journals per ListResponse message, so a collection with more journals than that cap returns its listing as several newline-delimited {result} frames. list() called response.json() once, which parses only the first frame and drops every journal after it (and throws outright for callers that read the whole body).

  • Pipe the response through the same splitStream/parseJSONStream/unwrapResult stages read() uses, drain it, and merge each frame's journals, so listings of any size return completely.
  • Return the full ProtocolListResponse rather than ProtocolJournalSpec[], preserving modRevision/route and matching the streamed shape.
  • Switch the error path to ResponseError.fromStreamResponse, since the streaming endpoint returns the wrapped {error} envelope instead of the unary {code} shape.

The broker's List RPC is server-streaming and caps the number of journals per `ListResponse` message, so a collection with more journals than that cap returns its listing as several newline-delimited `{result}` frames. `list()` called `response.json()` once, which parses only the first frame and drops every journal after it (and throws outright for callers that read the whole body).

* Pipe the response through the same `splitStream`/`parseJSONStream`/`unwrapResult` stages `read()` uses, drain it, and merge each frame's `journals`, so listings of any size return completely.
* Return the full `ProtocolListResponse` rather than `ProtocolJournalSpec[]`, preserving `modRevision`/`route` and matching the streamed shape.
* Switch the error path to `ResponseError.fromStreamResponse`, since the streaming endpoint returns the wrapped `{error}` envelope instead of the unary `{code}` shape.
jshearer added a commit to estuary/ui that referenced this pull request Jun 23, 2026
…urnals

The broker's journal `List` RPC is server-streaming and caps each `ListResponse` frame at 25 journals (gazette/core#466, down from 1000), so a collection split more than 25 ways returns its listing as several newline-delimited frames. `getJournals` parsed the body with a single `response.json()`, which failed on the second frame and surfaced as the generic "Server Error", leaving the preview with no journal to read.

* Bump vendored `data-plane-gateway` to a build whose `JournalClient.list()` consumes the stream and merges every frame (estuary/data-plane-gateway#51).
* Call `journalClient.list()` directly and remove the now-dead `getJournals` and `isNestedProtocolListResponse` helpers.
jshearer added a commit to estuary/ui that referenced this pull request Jun 23, 2026
…urnals

The broker's journal `List` RPC is server-streaming and caps each `ListResponse` frame at 25 journals (gazette/core#466, down from 1000), so a collection split more than 25 ways returns its listing as several newline-delimited frames. `getJournals` parsed the body with a single `response.json()`, which failed on the second frame and surfaced as the generic "Server Error", leaving the preview with no journal to read.

* Bump vendored `data-plane-gateway` to a build whose `JournalClient.list()` consumes the stream and merges every frame (estuary/data-plane-gateway#51).
* Call `journalClient.list()` directly and remove the now-dead `getJournals` and `isNestedProtocolListResponse` helpers.
jshearer added a commit to estuary/ui that referenced this pull request Jun 23, 2026
…urnals

The broker's journal `List` RPC is server-streaming and caps each `ListResponse` frame at 25 journals (gazette/core#466, down from 1000), so a collection split more than 25 ways returns its listing as several newline-delimited frames. `getJournals` parsed the body with a single `response.json()`, which failed on the second frame and surfaced as the generic "Server Error", leaving the preview with no journal to read.

* Bump vendored `data-plane-gateway` to a build whose `JournalClient.list()` consumes the stream and merges every frame (estuary/data-plane-gateway#51).
* Call `journalClient.list()` directly and remove the now-dead `getJournals` and `isNestedProtocolListResponse` helpers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant