Skip to content

test: compare device leaves by host:port, not identity - #106

Merged
Shinrai merged 1 commit into
nextfrom
test/slothlet-views
Nov 7, 2026
Merged

Shinrai merged 1 commit into
nextfrom
test/slothlet-views

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

From slothlet 3.23 a device leaf handed back by devices.get/devices.list is that module's view of the same leaf, so toBe identity checks fail even though it's the same device. The tests now compare host:port, and the shell-control tests check that stop() 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 from next.

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 cldmv-bot Bot added ! test → next v4 flow: test contributor PR targeting the next integration branch area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure type: documentation Relates to docs, README updates, guides, or inline code comments labels Nov 5, 2026
@Shinrai
Shinrai merged commit bfd089b into next Nov 7, 2026
30 checks passed
@cldmv-bot
cldmv-bot Bot deleted the test/slothlet-views branch November 7, 2026 05:11
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 -->

![coverage](https://img.shields.io/badge/coverage-92.2%25-brightgreen?style=for-the-badge&logo=vitest&logoColor=white)

| 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure ! test → next v4 flow: test contributor PR targeting the next integration branch type: documentation Relates to docs, README updates, guides, or inline code comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant