• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RobotWebTools / rclnodejs / 28150493030
91%

Build:
DEFAULT BRANCH: develop
Ran 25 Jun 2026 06:24AM UTC
Jobs 1
Files 65
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Jun 2026 06:07AM UTC coverage: 91.103% (-0.04%) from 91.143%
28150493030

push

github

web-flow
[Web runtime] Add SSE subscribe + CORS to HttpTransport (#1537)

Adds Server-Sent Events (SSE) subscription support and CORS to the HTTP transport, so browsers and other HTTP clients can `subscribe` to ROS topics over plain HTTP (no WebSocket required) and call the runtime cross-origin.

## Core (`lib/runtime/`)

- **`transports/http.js`** (+334 / −26) — the bulk of the change:
  - New `HttpSseConnection`: a long-lived `Connection` that streams one subscription as `text/event-stream`. The `200` SSE headers are deferred until the dispatcher acks (`{ok:true}`), so a rejected subscribe still returns a normal JSON error instead of a half-open stream; on success it emits a `ready` event (`{capability, subId:"sse"}`) followed by `message` events, and starts an unref'd keep-alive `setInterval`. Includes `_writeEvent`, `_writeError`, and a once-only close path.
  - `subscribe` is served only when `sse: true`, via `GET /capability/subscribe/<name>` (non-GET → `405` with `allow: GET`; unexposed / `sse` off → JSON `404`); `call` and `publish` continue to work as before.
  - CORS via `_applyCors` / `_normaliseCors`: `cors` accepts `true`/`'*'` (any origin), a single origin string, or an allow-list array. Allow-list mode echoes a matching `Origin` and sets `Vary: Origin`. `Access-Control-Allow-Headers` reflects the browser's `Access-Control-Request-Headers` on preflight (falling back to `content-type`), so `Authorization` and custom headers pass. `OPTIONS` preflight returns `204` for capability routes when CORS is on. CORS headers are applied first, so they appear on JSON replies, 204s, and SSE streams alike.
  - `sseKeepAliveMs` configurable (default `15000`, `0` disables).
- **`cli-config.js`** (+67 / −5) — new flags `--http-sse`, `--http-sse-keep-alive <ms>`, and repeatable `--http-cors <origin>`; maps to `http.sse` / `http.sseKeepAliveMs` / `http.cors`. DEFAULTS, validation, merge, HELP, and examples all updated.
- **`index.d.ts`** (+3) — `HttpTransportOptions... (continued)

2132 of 2509 branches covered (84.97%)

Branch coverage included in aggregate %.

361 of 401 new or added lines in 2 files covered. (90.02%)

5 existing lines in 1 file now uncovered.

17057 of 18554 relevant lines covered (91.93%)

225.38 hits per line

Uncovered Changes

Lines Coverage ∆ File
40
84.44
0.17% lib/runtime/transports/http.js

Coverage Regressions

Lines Coverage ∆ File
5
84.44
0.17% lib/runtime/transports/http.js
Jobs
ID Job ID Ran Files Coverage
1 28150493030.1 25 Jun 2026 06:24AM UTC 65
91.1
GitHub Action Run
Source Files on build 28150493030
  • Tree
  • List 65
  • Changed 4
  • Source Changed 2
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #28150493030
  • 9771c098 on github
  • Prev Build on develop (#28087511720)
  • Next Build on develop (#28153524004)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc