router: align SSE to canonical /api/{domain}/events (drop sse.json, derive from x-sse) #121
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_router!121
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_router_sse_canonical"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #120.
Aligns hero_router's SSE handling to the hero_lib macro/SDK canonical
/api/{domain}/eventsand removes thesse.jsondivergence. Builds on #118's per-domain spec cache.What changed
8dcffe5): the direct HTTP forward no longer renames/api/{domain}/events→ socket/api/{domain}/sse.json; it forwards the path as-is (matching hero_lib's ownopenrpc_proxy/serve_domains).x-sse(d1dfe88): replaced the blindGET /api/main/sse.jsonprobe with reading each domain's cached OpenRPCx-sseextension (endpoint + filter key).SseDescriptoris now per-domain{channel, domain, endpoint, filter_key}; an entry holds aVec(one per streaming domain). Removedprobe_events/EventsProbe. The multiplexer auto-exposes only firehose channels (no filter key) and streams the real endpoint — filtered per-resource streams (per-job/per-topic) have no global feed and are reached on demand via…/events?<filter>=<value>.4977424): unit-testsse_descriptors_from_entrywith the realx-sseshape (multi-domain filtered/firehose, no-@sse, single-domain Model-B).67e2f48, unrelated to SSE):derive_group_nameno longer treats thesocketsroot as a service group — a pre-existing failing unit test ondevelopment(the fix had only landed onintegration); included so the suite is green.Why no service-side change
SSE is per-(domain, method) with a filter — hero_proc is per-
job_sid, the demo's dom1 is per-topic, dom2 is a firehose. There is no global proc stream, so asse.jsonkeepalive stub would entrench a contract hero_lib already dropped. The fix is router-side; no services were changed.Verification
cargo test -p hero_router→ 143 passed, 0 failed; clippy clean. Verified live against the realhero_demo_server(dom1/dom2@sse) ondevelopment:dom1→/api/dom1/eventsfilter=topic;dom2→/api/dom2/eventsno filterGET /hero_demo/api/dom2/events→ 200text/event-stream(verbatim)GET /hero_demo/api/dom1/events?topic=demo→ 200text/event-stream…/sse.json→ 404 (no longer used)The direct HTTP forward renamed external /api/{domain}/events to socket /api/{domain}/sse.json — the only HTTP<->socket divergence, and it doesn't match the hero_lib canonical (serve_domains/openrpc_proxy serve SSE at /api/{domain}/events verbatim; there is no sse.json). Forward the path as-is so direct/admin SSE clients hit the real per-domain stream. Refs #120Replaces the blind GET /api/main/sse.json probe with deriving SSE channels from each domain's cached OpenRPC x-sse extension (endpoint + filter key). Canonical /api/<domain>/events (multi-domain) or /api/events (single-domain Model-B); no sse.json anywhere. - SseDescriptor is now per-domain {channel, domain, endpoint, filter_key}; an entry holds a Vec (one per streaming domain) instead of Option. - scanner::sse_descriptors_from_entry builds them from domain_specs/openrpc_json. - removed probe_events / EventsProbe (no socket probe). - multiplexer auto-exposes only firehose channels (no filter_key) — filtered per-resource streams (per-job/per-topic) have no global feed and are reached on demand via .../events?<filter>=<value>; resolve + stream the real endpoint instead of bare /events. Refs #120