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

RobotWebTools / rclnodejs / 23186147185
86%

Build:
DEFAULT BRANCH: develop
Ran 17 Mar 2026 09:09AM UTC
Jobs 1
Files 52
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:55AM UTC coverage: 85.964% (-0.04%) from 85.999%
23186147185

push

github

web-flow
Expose MessageInfo metadata on subscription callbacks (#1440)

Exposes ROS 2 message metadata (timestamps, sequence numbers, publisher GID) to subscription callbacks, matching rclpy's `MessageInfo` pattern. When a subscription callback declares two parameters, it automatically receives a `MessageInfo` object as the second argument containing metadata from the middleware layer. Single-parameter callbacks are unchanged — no performance overhead, full backward compatibility.

**New files:**

- `lib/message_info.js` — `MessageInfo` class wrapping native `rmw_message_info_t` fields: `sourceTimestamp` (bigint), `receivedTimestamp` (bigint), `publicationSequenceNumber` (bigint), `receptionSequenceNumber` (bigint), `publisherGid` (Buffer). Includes `toPlainObject()` helper.
- `types/message_info.d.ts` — Full TypeScript declarations for `MessageInfo`.
- `test/test-message-info.js` — 6 tests covering: MessageInfo delivery with 2-param callbacks, non-delivery with 1-param callbacks, timestamp validity, timestamp ordering, `toPlainObject()`, and export verification.

**Modified files:**

- `src/rcl_subscription_bindings.cpp` — Added `RclTakeWithInfo()` native function that calls `rcl_take()` with `rmw_message_info_t` (instead of `nullptr`) and returns a JS object with all metadata fields as BigInts and a GID Buffer. Registered as `rclTakeWithInfo` binding. Added `#include <rmw/types.h>`.
- `lib/subscription.js` — Added `_wantsMessageInfo` flag detected via `callback.length >= 2`. Added `wantsMessageInfo` readonly getter. Updated `processResponse()` to accept optional `messageInfo` second parameter and forward it to the callback when the flag is set.
- `lib/node.js` — Updated subscription spin loop: when `subscription.wantsMessageInfo` is true, uses `rclTakeWithInfo` and wraps the result in `MessageInfo`; otherwise uses the existing `rclTake` path (zero overhead for 1-param callbacks). Added `MessageInfo` require.
- `index.js` — Exported `MessageInfo` class.
- `ty... (continued)

1464 of 1851 branches covered (79.09%)

Branch coverage included in aggregate %.

22 of 23 new or added lines in 3 files covered. (95.65%)

3007 of 3350 relevant lines covered (89.76%)

455.35 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
91.67
-3.16% lib/subscription.js
Jobs
ID Job ID Ran Files Coverage
1 23186147185.1 17 Mar 2026 09:09AM UTC 52
85.96
GitHub Action Run
Source Files on build 23186147185
  • Tree
  • List 52
  • 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 #23186147185
  • aa6f1d3c on github
  • Prev Build on develop (#23185128427)
  • Next Build on develop (#23227191864)
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