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
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.tsinternals on top ofsubscribeToEventSource()from@lsst-sqre/sse-client, per PRD #524 §Scope bullet 2. The public API is preserved exactly —subscribeToHtmlEvents(),createHtmlEventsUrl(),SubscribeOptions,HtmlEventCallback,SseErrorCallbacksignatures unchanged. Zod validation ofHtmlEvent, auto-abort onexecution_status === 'complete' && html_hash,onComplete, and the optional structuredLogger(including logging scheduled reconnects) all stay in this layer. Reconnect policy is the library default (automatic backoff, honoring serverretry:, including after 4xx), with connection errors surfaced throughonErrorwhere detectable. Replace the@microsoft/fetch-event-sourcedependency with@lsst-sqre/sse-client(workspace:*) inpackages/times-square-client/package.json. Include a changeset for@lsst-sqre/times-square-client.Acceptance criteria
packages/times-square-clientno longer depends on@microsoft/fetch-event-source; it depends on@lsst-sqre/sse-clientinstead.src/sse.test.tspasses: valid event →onEvent; malformed JSON ignored; Zod-invalid payload rejected with logger warning; auto-abort +onCompleteon completion event; cleanup function aborts the connection.pnpm type-checkandpnpm test --filter @lsst-sqre/times-square-clientpass from the repo root.@lsst-sqre/times-square-client.