Repository navigation
test: compare device leaves by host:port, not identity - #106
Merged
Merged
Conversation
From slothlet 3.23, a leaf handed out through devices.get/list is that module's view of the leaf, so toBe() against the device module's copy fails even though it's the same device. The tests now compare host:port and check that a shell control's stop() reaches the real one. Passes on slothlet 3.22.1 and on 3.24.1 from next (the #708 fix).
cldmv-bot Bot
added a commit
that referenced
this pull request
Nov 22, 2026
# DroidSock v2.2.1 Changelog **Release Date**: November 2026 **Release Type**: Patch **Branch**: `release/2.2.1` --- ## Overview v2.2.1 keeps `@cldmv/slothlet` below 3.24.0. slothlet 3.24.0 hands sockets back to droidsock as proxies, so `device.connect()` throws `TypeError: Illegal invocation` on every install that resolves it. The `^3.22.1` range in v2.2.0 allowed 3.24.0, so a fresh install of v2.2.0 picks it up today; v2.2.1 narrows the range to `>=3.22.1 <3.24.0`. No droidsock code changed. The rest of the release is test and CI work: the Vitest suite now also runs against the built `dist/`, and the dev export condition actually reaches the test workers. --- ## 🐛 Bug Fixes ### `@cldmv/slothlet` capped below 3.24.0 ([#112](#112)) From 3.24.0, slothlet hands out a proxy for a `net.Socket` (or any `node:stream` object) that a module returns, and native calls on it fail with `TypeError: Illegal invocation` ([slothlet#708](CLDMV/slothlet#708)). droidsock's connection module creates the socket and the device module calls `socket.setKeepAlive()` on it, so every `device.connect()` threw. 3.23.0 is not affected. The dependency range moves from `^3.22.1` to `>=3.22.1 <3.24.0`. The lockfile stays on 3.22.1. No fixed 3.24.x is planned, because slothlet's next release is 4.0.0; moving to slothlet 4 is separate work. Packages that depend on droidsock and pinned slothlet with an npm `overrides` entry to work around this can drop the override once they require `@cldmv/droidsock` `^2.2.1`. ## 🧪 Tests - The Vitest config sets the `droidsock-dev` condition with `devCondition()` from `@cldmv/configs` 1.4.0. The old `test.nodeOptions` setting isn't a Vitest option, so the condition never reached the test workers ([#103](#103)). - `npm run test:dist` builds `dist/` and runs the Vitest suite against it. `npm test` and `ci:coverage` include it ([#107](#107)). - The device tests compare leaves by `host:port` instead of object identity, and the shell-control tests check that `stop()` reaches the real control. From slothlet 3.23, `devices.get()` and `devices.list()` return each module's own view of the same leaf, so identity checks failed although the device was the same ([#106](#106)). ## 🔧 CI & tooling - New `sync-release-notes.yml` companion workflow from the v4 template, unchanged. It keeps GitHub Release bodies in step with the per-version changelog files and creates missing version tags ([#110](#110)). ## 📚 Documentation - **NEW:** [docs/changelog/v2/v2.2.1.md](https://github.com/CLDMV/droidsock/blob/v2.2.1/docs/changelog/v2/v2.2.1.md): this changelog. - `docs/API.md` and the `devices.get()` JSDoc no longer promise "the exact same object" across a disconnect and reconnect; they say the same leaf or device, which is what callers can rely on ([#106](#106)). - README: the source-layout section mentions `npm run test:dist` ([#107](#107)). - README **✨ What's New** updated for v2.2.1. ## 🔧 Dependencies Runtime: - `@cldmv/slothlet` `^3.22.1` → `>=3.22.1 <3.24.0`, locked at 3.22.1 (see Bug Fixes). Dev-only: - `@cldmv/configs` `^1.3.0` → `^1.4.0` ([#103](#103)). --- ## Upgrade notes - Drop-in for v2.2.0; the API and runtime code are unchanged. - If your install resolved `@cldmv/slothlet` 3.24.0 under v2.2.0, updating to v2.2.1 moves it back to 3.23.x or 3.22.x and `device.connect()` works again. <details> <summary>👥 Contributors</summary> - @Shinrai </details> --- <!-- coverage-start -->  | Metric | Coverage | |--------|----------| | Statements | 93.4% | | Branches | 85.8% | | Functions | 94.7% | | Lines | 95.0% | *Avg: **92.2%** · `96329ba` · Node lts/** <!-- coverage-end --> <!-- co-authors --> Co-authored-by: Shinrai <[email protected]>
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.
From slothlet 3.23 a device leaf handed back by
devices.get/devices.listis that module's view of the same leaf, sotoBeidentity checks fail even though it's the same device. The tests now comparehost:port, and the shell-control tests check thatstop()reaches the real control. Two doc lines that promised "the exact same object" are reworded. Passes on slothlet 3.22.1 and on 3.24.1 fromnext.