mirror of https://github.com/openclaw/openclaw.git
Matrix: cover crypto runtime require boundary
This commit is contained in:
parent
6f98ee7f62
commit
61d99628f9
|
|
@ -127,6 +127,7 @@ Docs: https://docs.openclaw.ai
|
|||
- Daemon/status: surface immediate gateway close reasons from lightweight probes and prefer those concrete auth or pairing failures over generic timeouts in `openclaw daemon status`. (#56282) Thanks @mbelinky.
|
||||
- Agents/failover: classify HTTP 410 errors as retryable timeouts by default while still preserving explicit session-expired, billing, and auth signals from the payload. (#55201) thanks @nikus-pan.
|
||||
- Agents/subagents: restore completion announce delivery for extension channels like BlueBubbles. (#56348)
|
||||
- Plugins/Matrix: load bundled `@matrix-org/matrix-sdk-crypto-nodejs` through `createRequire(...)` so E2EE media send and receive keep the package-local native binding lookup working in packaged ESM builds. (#54566) thanks @joelnishanth.
|
||||
|
||||
## 2026.3.24
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { build } from "esbuild";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const sdkDir = path.dirname(fileURLToPath(import.meta.url));
|
||||
const cryptoNodeRuntimePath = path.join(sdkDir, "crypto-node.runtime.ts");
|
||||
|
||||
describe("crypto-node runtime bundling", () => {
|
||||
it("keeps the native Matrix crypto package behind a runtime require boundary", async () => {
|
||||
const result = await build({
|
||||
entryPoints: [cryptoNodeRuntimePath],
|
||||
bundle: true,
|
||||
external: ["@matrix-org/matrix-sdk-crypto-nodejs"],
|
||||
format: "esm",
|
||||
platform: "node",
|
||||
write: false,
|
||||
});
|
||||
|
||||
const bundled = result.outputFiles.at(0)?.text ?? "";
|
||||
|
||||
expect(bundled).toContain('from "node:module"');
|
||||
expect(bundled).toContain("createRequire(import.meta.url)");
|
||||
expect(bundled).toMatch(/require\d*\("@matrix-org\/matrix-sdk-crypto-nodejs"\)/);
|
||||
expect(bundled).not.toContain('from "@matrix-org/matrix-sdk-crypto-nodejs"');
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue