Skip to content

fix(router): event relays UI contract (stacks on #327) - #331

Merged
kkopanidis merged 4 commits into
feat/router-event-relaysfrom
cursor/event-relays-ui-interventions-5ab6
Sep 12, 2026
Merged

fix(router): event relays UI contract (stacks on #327)#331
kkopanidis merged 4 commits into
feat/router-event-relaysfrom
cursor/event-relays-ui-interventions-5ab6

Conversation

@kkopanidis

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

  • Bugfix
  • Refactor

Does this PR introduce a breaking change?

  • No

Summary

Stacks on #327 (feat/router-event-relays) and aligns the Event Relays Admin UI with the Event Relays intervention plan:

  • Browser snippet uses auth: { token: accessToken } and re-subscribes inside connect
  • Database example defaults: documentId + { "id": "{{payload.documentId}}" }; CRUD bus example documents _id and /database/ duplication warning
  • Template preview via POST /router/event-relays/preview (404 → clear unavailable state); removed client-side template renderer
  • Zod field errors for invalid JSON templates
  • Page uses Promise.allSettled with compatibility empty state when /router/event-relays is missing
  • Inline Active switch on table rows (PATCH active); edit dialog omits Active
  • Docs: subscribe-only, no replay, Authorization required, documentId vs _id
  • Companion backend: feat(router): add ReBAC-protected event-to-socket relays Conduit#1600 (not #1588)

Test plan

  • pnpm test:event-relays
  • Open /router/event-relays against Router with event-relays API — create/edit, inline Active toggle, server preview
  • Open page against Router without /router/event-relays — compatibility empty state
  • Preview against Router without preview route — unavailable message
Open in Web Open in Cursor 

cursoragent and others added 4 commits September 12, 2026 12:16
Use auth.token client snippets with subscribe on connect, documentId
defaults, server preview API, inline Active toggles, API 404 fallback,
and docs for subscribe-only ReBAC delivery.

Co-authored-by: Konstantinos Kopanidis <kkopanidis@users.noreply.github.com>
Align preview with Conduit #1604 (messageTemplate, samplePayload,
{ rendered }), debounce preview inputs by string, drop live-path
unsubscribe from snippets, omit active on edit PATCH, and skip the
sockets warning when Router settings fail to load.

Co-authored-by: Konstantinos Kopanidis <kkopanidis@users.noreply.github.com>
Derive preview sample JSON from the relay resourceIdPath on edit,
walk error.cause in isAxiosNotFoundError for RSC-wrapped axios
failures, and add contract tests for sample payload and 404 detection.

Co-authored-by: Konstantinos Kopanidis <kkopanidis@users.noreply.github.com>
Extract preview error coercion with isNextNavigationError so debounced
preview does not swallow NEXT_REDIRECT as a field error.

Co-authored-by: Konstantinos Kopanidis <kkopanidis@users.noreply.github.com>
@kkopanidis
kkopanidis marked this pull request as ready for review September 12, 2026 23:37
@kkopanidis
kkopanidis merged commit ba21f03 into feat/router-event-relays Sep 12, 2026
3 checks passed
@kkopanidis
kkopanidis deleted the cursor/event-relays-ui-interventions-5ab6 branch September 12, 2026 23:37
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