diff --git a/identity/tests/did-cache_test.ts b/identity/tests/did-cache_test.ts index fc3f1f5..c1f48cb 100644 --- a/identity/tests/did-cache_test.ts +++ b/identity/tests/did-cache_test.ts @@ -83,7 +83,8 @@ Deno.test({ // let's mess with the cached doc so we get something different didCache.cacheDid(did, { ...doc, id: "did:example:alice" }); - await wait(1); + // Wait longer than staleTTL (1ms) to ensure entry becomes stale + await wait(5); // first check the cache & see that we have the stale value const cached = shortCacheResolver.cache?.checkCache(did); @@ -112,7 +113,8 @@ Deno.test({ // again, we mess with the cached doc so we get something different didCache.cacheDid(did, { ...doc, id: "did:example:alice" }); - await wait(1); + // Wait longer than maxTTL (1ms) to ensure entry expires + await wait(5); // see that the resolver does not return expired value & instead force refreshes const staleGet = await shortExpireResolver.resolve(did); diff --git a/xrpc-server/mod.ts b/xrpc-server/mod.ts index a4b907d..68ec262 100644 --- a/xrpc-server/mod.ts +++ b/xrpc-server/mod.ts @@ -19,6 +19,11 @@ * Works with Deno, Node.js, Bun, Cloudflare Workers, and other JavaScript runtimes * supported by Hono. * + * Note: Subscription (WebSocket) endpoints are currently supported only in Deno + * and Cloudflare Workers. On Node.js and Bun, query/procedure routes function + * normally, but subscription endpoints are not yet available (WebSocket upgrades + * will be rejected or unmounted). + * * @example Basic server setup with a simple endpoint * ```ts * import { createServer } from "jsr:@atp/xrpc-server"; diff --git a/xrpc-server/tests/subscriptions_test.ts b/xrpc-server/tests/subscriptions_test.ts index 745bb01..0d30093 100644 --- a/xrpc-server/tests/subscriptions_test.ts +++ b/xrpc-server/tests/subscriptions_test.ts @@ -460,6 +460,10 @@ Deno.test("subscription consumer reconnects w/ param update", async () => { } } + // Allow internal subscription cleanup (heartbeat interval & socket close) to settle + // so Deno's leak detector doesn't flag the pending timer from the generator's wait(0). + await new Promise((r) => setTimeout(r, 0)); + // Ensure we actually received the expected early messages assertEquals(messagesReceived >= 2, true); } finally {