Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

E2E: use undici 6, the major Node 22's fetch bundles, for the shared dispatcher

undici 7's Agent under Node 22's fetch failed request bodies ("fetch failed" on the
legacy cache and artifact uploads, "invalid content-length header" from Octokit). The
module now refuses to load with a clear message if the majors ever differ.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M5tHXfgBQaLEPM9iUPrp8n
Claude authored signed1 parent ace2bebcommit 1b49740706432015a98a070b14614e88af4bc4a8Browse files
3 files changed+18−3
modifiedapps/diffinery/package.json+1−1View file
@@ -46,7 +46,7 @@
4646 "react": "19.2.0",
4747 "react-dom": "19.2.0",
4848 "typescript": "^5.9.3",
49- "undici": "7.29.1",
49+ "undici": "6.23.0",
5050 "vitest": "^4.1.0",
5151 "wrangler": "^4.149.0"
5252 }
modifiedapps/diffinery/test/e2e/fresh-connections.mjs+9−0View file
@@ -5,6 +5,15 @@
55 // waits unread, the next fetch reuses the dead connection and fails with "fetch failed" (other side
66 // closed, UND_ERR_SOCKET), and so does the test. A new localhost connection per request costs well under
77 // a millisecond; Node's fetch and WebSocket use this dispatcher.
8+//
9+// Node's fetch is its own bundled undici, which only works with a dispatcher from the same major
10+// version (undici 7's Agent under Node 22's fetch fails request bodies), so the undici dev dependency
11+// follows Node's: Node 22 bundles undici 6.
812 import { Agent, setGlobalDispatcher } from "undici";
13+import { createRequire } from "node:module";
914
15+const ours = createRequire(import.meta.url)("undici/package.json").version;
16+if (ours.split(".")[0] !== process.versions.undici.split(".")[0]) {
17+ throw new Error(`apps/diffinery's undici dev dependency (${ours}) must have the major version of the undici in Node ${process.version} (${process.versions.undici})`);
18+}
1019 setGlobalDispatcher(new Agent({ pipelining: 0 }));
modifiedpnpm-lock.yaml+8−2View file
@@ -122,8 +122,8 @@
122122 specifier: ^5.9.3
123123 version: 5.9.3
124124 undici:
125- specifier: 7.29.1
126- version: 7.29.1
125+ specifier: 6.23.0
126+ version: 6.23.0
127127 vitest:
128128 specifier: ^4.1.0
129129 version: 4.1.11(@types/node@22.20.5)(vite@8.3.4(@types/node@22.20.5)(esbuild@0.25.11)(yaml@2.9.1))
@@ -2187,6 +2187,10 @@
21872187 undici-types@6.21.0:
21882188 resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
21892189
2190+ undici@6.23.0:
2191+ resolution: {integrity: sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==}
2192+ engines: {node: '>=18.17'}
2193+
21902194 undici@7.29.0:
21912195 resolution: {integrity: sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==}
21922196 engines: {node: '>=20.18.1'}
@@ -4094,6 +4098,8 @@
40944098
40954099 undici-types@6.21.0: {}
40964100
4101+ undici@6.23.0: {}
4102+
40974103 undici@7.29.0: {}
40984104
40994105 undici@7.29.1: {}