Mark ROADMAP 2.1 and 2.2 as DONE — both are fixed, tested, and documented

Open Beginner friendly
#391 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
javascript
Domain
documentation

Research direction

Start in ROADMAP.md at §§2.1 and 2.2, then check the cited implementations in lib/message.js, lib/dbus-buffer.js, index.js, and the coverage in test/message-framing.js and test/errors.js. Compare the status with docs/api.md's handlerError documentation; done means both roadmap sections clearly show DONE and point to the shipped protections and behavior.

Written by the indexing model from the issue text.

Description

documentation
  • Priority rationale: ROADMAP still headlines "a hostile peer can crash the process" for hardening that has shipped; a contributor picking work from it would redo (or distrust) a finished section
  • Possible duplicate: none (checked gh issue list -R sidorares/dbus-native --state all --limit 200 --search "ROADMAP")

Summary

ROADMAP.md marks finished items with — DONE (2.3–2.7, 2.9 all carry it), but §2.1 "Harden the read loop against malformed input" and §2.2 "Isolate user handlers from the read loop" do not — and at 0.15.1 every bullet in both sections is implemented, has tests, and is documented in docs/api.md. The two sections still open with "Severity: high — a hostile or buggy peer can crash the process" and "an ordinary application bug kills the process", neither of which is true anymore.

Evidence

Checked at 0.15.1 (commit 147c145), bullet by bullet against §2.1:

ROADMAP §2.1 bullet where it is fixed
"Enforce the spec limits… a peer declaring a 900 MB body makes us buffer 900 MB" lib/message.js:80-93 rejects declared sizes over constants.maxMessageSize (lib/constants.js:64, 128 MiB) with a ProtocolError, before any allocation
"Fix the int32 overflow at message.js:25 (((fieldsLength + 7) >> 3) << 3 yields −16)" lib/message.js:10-15: align8 is now Math.ceil(n / 8) * 8, with a comment explaining exactly this wrap
"Guard the no-body case in message.unmarshall()… every argument-less message throws" lib/message.js:226-228: if (headers[4] > 0 && message.signature), matching the streaming path's guard at lib/message.js:159
"Make readString reject rather than truncate" lib/dbus-buffer.js:135-142 throws Declared string length … runs past the end of the message, with the trailing-NUL byte accounted for
"Give the parse loop an error boundary" lib/message.js:45-52 (fail() stops reading and reports once); index.js routes it to a connection 'error' and destroys the stream, with a comment that framing is unrecoverable

And §2.2: dispatch is wrapped at lib/message.js:185-190 — a throw from onMessage goes to the onHandlerError callback instead of unwinding through the parser — and index.js:284-297 turns that into the 'handlerError' event, preserving Node's crash default (via process.nextTick rethrow) when nobody listens. This is public, documented behaviour: docs/api.md's connection-events table lists handlerError ("an exception thrown by one of your message/signal listeners", api.md:1046) and distinguishes it from 'error'. Tests cover both sections: test/message-framing.js (framing, size limits, ProtocolError) and test/errors.js.

For contrast, §2.8 in the same file was updated in place when its status changed ("Scoped 2026-07-29… DONE, and further than planned"), so §§2.1–2.2 read as if they are the two remaining live hazards in the wire layer.

Proposed fix / API

Append — DONE to both headings and a one-line pointer each, in the style §2.9 uses ("Landed in #312"): for §2.1 name the size cap, align8, the unmarshall guard, readString, and fail(); for §2.2 name onHandlerError/'handlerError' and the nobody-listening rethrow. Optionally strike the two "Severity: high" lines, since the text beneath them is now history rather than a finding.

Impact

Anyone triaging what to build against the library reads these two sections as open high-severity holes in the read path — the exact opposite of the current state, where malformed-input handling is one of the better-tested parts of the package. Cheap fix, misleading while it lasts.

References

  • ROADMAP.md §§2.1, 2.2, 2.9 at 0.15.1
  • docs/api.md "Events" table (error vs handlerError)
Dominant language
JavaScript
Stars
269
Forks
101
Avg merge
5d 7h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sidorares/dbus-native

All issues in sidorares/dbus-native

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.