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

RobotWebTools / rclnodejs / 23185128427
86%

Build:
DEFAULT BRANCH: develop
Ran 17 Mar 2026 08:49AM UTC
Jobs 1
Files 51
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

17 Mar 2026 08:26AM UTC coverage: 85.999% (+0.06%) from 85.941%
23185128427

push

github

web-flow
Add ParameterEventHandler for cross-node parameter monitoring (#1438)

Adds `ParameterEventHandler`, a new class that monitors parameter changes on any node in the ROS 2 graph by subscribing to the `/parameter_events` topic. This is the rclnodejs equivalent of rclpy's `ParameterEventHandler` and supports two callback types: per-parameter callbacks (filtered by parameter name and node name) and event-level callbacks (for every `ParameterEvent` message). Refactors `ParameterWatcher` to use `ParameterEventHandler` internally, eliminating its direct `/parameter_events` subscription while preserving full API compatibility.

**New files:**

- `lib/parameter_event_handler.js` — Core implementation with `addParameterCallback()`, `removeParameterCallback()`, `addParameterEventCallback()`, `removeParameterEventCallback()`, `destroy()`, and static helpers `getParameterFromEvent()` / `getParametersFromEvent()`. Uses opaque handle objects for add/remove symmetry matching rclpy. Callbacks dispatched in FILO order. QoS option correctly forwarded via options object to `createSubscription()`. Parameter names trimmed before storage to prevent whitespace mismatch. Dispatch loop inverted to O(event_params) via direct Map lookups instead of O(registered_callbacks).
- `types/parameter_event_handler.d.ts` — Full TypeScript declarations for `ParameterEventHandler`, `ParameterCallbackHandle`, `ParameterEventCallbackHandle`, and `ParameterEventHandlerOptions`.
- `test/test-parameter-event-handler.js` — 23 tests covering constructor validation, parameter callbacks (add/remove/filtering by node and param name), event callbacks, static helpers, lifecycle/destroy, and Node convenience method integration.

**Modified files:**

- `lib/node.js` — Added `createParameterEventHandler()` and `destroyParameterEventHandler()` convenience methods with lifecycle tracking via `_parameterEventHandlers` array. Auto-cleanup on node destruction.
- `index.js` — Exported `ParameterEventHandler` cla... (continued)

1457 of 1839 branches covered (79.23%)

Branch coverage included in aggregate %.

122 of 132 new or added lines in 3 files covered. (92.42%)

2990 of 3332 relevant lines covered (89.74%)

455.81 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
87.63
0.19% lib/node.js
1
90.7
0.15% lib/parameter_watcher.js
8
86.29
lib/parameter_event_handler.js
Jobs
ID Job ID Ran Files Coverage
1 23185128427.1 17 Mar 2026 08:49AM UTC 51
86.0
GitHub Action Run
Source Files on build 23185128427
  • Tree
  • List 51
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #23185128427
  • 607e03a1 on github
  • Prev Build on develop (#23176049662)
  • Next Build on develop (#23186147185)
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