chore(deps): drop aedes-server-factory; the tcp listener is bare node:net - #8
Merged
Merged
Conversation
…:net Remove the aedes-server-factory dependency (^0.2.1) and replace its one call site with net.createServer((socket) => aedes.handle(socket)) in src/broker/index.ts. Recorded as D-024. The package has been dead since 2021-06-28, hard-depends on ws@7 (the exact package whose Bun stand-in forced the hand-built ws listener in the first place) and aedes-protocol-decoder, and offbook used it for a single line. Read from its source: with no options its path reduces to net.createServer + aedes.handle plus a req.connDetails field, and nothing in the repo reads connDetails (repo-wide grep, exit 1), so the replacement is behaviorally equivalent for offbook's use. The removal drops aedes-server-factory, aedes-protocol-decoder and ws@7.5.11 from the lockfile; ws@8 remains via mqtt (dev) and the Stryker runner. This is the one aedes-adjacent change that does NOT move the floor under R-006/R-007: the spike surface (aedes core at 0.51.x + the hand-built ws listener) is untouched. D-021's deferral of aedes 1.x stands, narrowed - the 1.x migration no longer involves replacing this package. D-024 also records the probe results that de-risk that future bump: aedes 1.1.1 runs under Bun (10-check probe, exit 0, driven exactly the way src/broker drives 0.51), with a migration delta of roughly ten lines. The Biome noRestrictedImports entry and the transport-isolation regex both keep listing the package deliberately: they now guard against reintroduction. Negative control verified with the package uninstalled: a planted aedes-server-factory import outside src/broker/ makes lint exit 1; the clean tree exits 0. New test in src/broker/fingerprint.test.ts: the tcp listener round-trips data both ways (a QoS-1 publish reaches onInbound, an emit reaches a tcp subscriber). The pre-existing tcp coverage stopped at the CONNECT handshake, which would not have caught a listener that handshakes but drops data. Gates: check-docs, lint, typecheck, demo-app:build and full bun test all exit 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the
aedes-server-factorydependency and replaces its one call site withnet.createServer((socket) => aedes.handle(socket)). Recorded as D-024. This is the follow-up D-021 pointed at: the package was already identified there as "not a maintained path to 1.x".Why it can go
ws@7(the exact package whose Bun stand-in is why the ws listener is hand-built) andaedes-protocol-decoder; offbook called it once, for the tcp listener.net.createServer+aedes.handleplus areq.connDetailsfield. Nothing in the repo readsconnDetails(repo-wide grep, exit 1). The only delta is an unread metadata field.aedes-server-factory,aedes-protocol-decoderandws@7.5.11from the lockfile.ws@8remains viamqtt(dev) and the Stryker runner; neither is a runtime path ofbroker/.Why now, given D-021 defers aedes 1.x
This is the one aedes-adjacent change that does not move the floor under R-006/R-007: aedes stays at 0.51.x and the hand-built ws listener (the spike surface) is untouched. It clears the only structural obstacle on the 1.x path.
D-024 also records the probe results that de-risk the future bump: aedes 1.1.1 runs under Bun (10-check probe, exit 0, driven exactly the way
src/broker/drives 0.51:preConnect,handle()on a socket, the event shapes,publish(packet, cb),createRetainedStream("#")as a Readable,close(cb)). The remaining migration delta is roughly ten lines. The deferral itself stands: 1.x changes runtime defaults (drainTimeout: 60000, amaxTopicLevelsclamp, keepalive limits) and the spikes measure against defaults, so they still run first.Guards kept deliberately
The Biome
noRestrictedImportsentry foraedes-server-factoryand thetest/transport-isolation.test.tsregex both keep listing the package: they now guard against reintroduction. Negative control verified with the package uninstalled: a planted import outsidesrc/broker/makes lint exit 1; the clean tree exits 0.test/lint-gate.test.tscontinues to assert the Biome entry, unchanged.New coverage
The pre-existing tcp test stopped at the CONNECT handshake, which would not have caught a listener that handshakes but drops data. A new test in
src/broker/fingerprint.test.tsproves the replacement listener round-trips data both ways: a QoS-1 publish reachesonInbound, and anemitreaches a tcp subscriber.Gates
check-docs,lint,typecheck,demo-app:buildand fullbun testall exit 0.