Skip to content

fix: correct SSE connectSSE type cast and explicit url#17

Merged
intel352 merged 2 commits intofeat/tracing-visualizationfrom
copilot/sub-pr-15
Mar 6, 2026
Merged

fix: correct SSE connectSSE type cast and explicit url#17
intel352 merged 2 commits intofeat/tracing-visualizationfrom
copilot/sub-pr-15

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

connectSSE in ui/src/utils/sse.ts was casting onEvent to (event: unknown) => void, which is incompatible with SSEConfig's required signature, and omitted the url property — breaking the TypeScript build.

Changes:

  • Pass url: '/events' explicitly to satisfy SSEConfig
  • Fix onEvent cast to (event: { type: string; data: unknown; [key: string]: unknown }) => void matching the actual SSEConfig contract
  • Move SSE error suppression from post-hoc es.onerror assignment to SSEConfig.onError
// Before
const es = sharedConnectSSE({ onEvent: onEvent as (event: unknown) => void });
es.onerror = () => { /* suppress */ };

// After
const es = sharedConnectSSE({
  url: '/events',
  onEvent: onEvent as (event: { type: string; data: unknown; [key: string]: unknown }) => void,
  onError: () => { /* suppress */ },
});

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for X-Workflow-Trace header in CORS fix: correct SSE connectSSE type cast and explicit url Mar 6, 2026
@intel352 intel352 marked this pull request as ready for review March 6, 2026 05:50
@intel352 intel352 merged commit f78efc3 into feat/tracing-visualization Mar 6, 2026
@intel352 intel352 deleted the copilot/sub-pr-15 branch March 6, 2026 05:50
intel352 added a commit that referenced this pull request Mar 6, 2026
* config: add X-Workflow-Trace to CORS allowedHeaders

Allow browser clients to send the X-Workflow-Trace: true header for
explicit step I/O capture. Previously only curl/server-to-server
requests could send this header without CORS preflight rejection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* deps: upgrade workflow to v0.3.12 for X-Workflow-Trace header support

v0.3.12 adds X-Workflow-Trace request header support that gates explicit
step I/O capture. Ratchet's CORS allowedHeaders already includes
X-Workflow-Trace (added in the previous commit). This upgrade makes
ratchet compatible with the new tracing features.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* cleanup: remove unwired authz/observability modules and extra deps from trace header PR (#16)

* Initial plan

* cleanup: remove unused otel/authz/metrics modules and extra deps per review feedback

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* fix: correct SSE connectSSE type cast and explicit url (#17)

* Initial plan

* fix: pass url and correct event type in SSE connectSSE call

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* fix: use SSEEvent type in onEvent cast instead of inline type shape (#18)

* Initial plan

* fix: use SSEEvent type in onEvent cast instead of inline type shape

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
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.

2 participants