Skip to content

DM-55381: Rewrite times-square-client SSE on @lsst-sqre/sse-client #526

Description

@jonathansick

Branch

tickets/DM-55381

Type

AFK

Jira Key

DM-55381

Jira URL

https://rubinobs.atlassian.net/browse/DM-55381

Blocked by

#525

Parent PRD

#524

Task Order

2

Parallel with

Scope

Rewrite packages/times-square-client/src/sse.ts internals on top of subscribeToEventSource() from @lsst-sqre/sse-client, per PRD #524 §Scope bullet 2. The public API is preserved exactly — subscribeToHtmlEvents(), createHtmlEventsUrl(), SubscribeOptions, HtmlEventCallback, SseErrorCallback signatures unchanged. Zod validation of HtmlEvent, auto-abort on execution_status === 'complete' && html_hash, onComplete, and the optional structured Logger (including logging scheduled reconnects) all stay in this layer. Reconnect policy is the library default (automatic backoff, honoring server retry:, including after 4xx), with connection errors surfaced through onError where detectable. Replace the @microsoft/fetch-event-source dependency with @lsst-sqre/sse-client (workspace:*) in packages/times-square-client/package.json. Include a changeset for @lsst-sqre/times-square-client.

Acceptance criteria

  • packages/times-square-client no longer depends on @microsoft/fetch-event-source; it depends on @lsst-sqre/sse-client instead.
  • Public SSE exports and their signatures are unchanged (no consumer code changes required to compile).
  • New src/sse.test.ts passes: valid event → onEvent; malformed JSON ignored; Zod-invalid payload rejected with logger warning; auto-abort + onComplete on completion event; cleanup function aborts the connection.
  • pnpm type-check and pnpm test --filter @lsst-sqre/times-square-client pass from the repo root.
  • A changeset exists for @lsst-sqre/times-square-client.

Metadata

Metadata

Assignees

Labels

prd-taskImplementation task from a PRD

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions