From 2bb18a9e9609448581bfde3b43f208c3125a9192 Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Wed, 7 Oct 2026 09:34:06 -0500 Subject: [PATCH] fixup! diigo-cache: diigo counts pages from 0; migrate stored pages (schema v2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docs per the docs-files-api skill: a 1–2 line @file; what a declaration is or does in JSDoc on it, not in // comments or the file header. Generated-by: Claude Opus 5.5 --- diigo-cache/tests/fake-webapp.js | 15 +++++++-------- diigo-cache/tests/test-worker.ts | 9 +++------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/diigo-cache/tests/fake-webapp.js b/diigo-cache/tests/fake-webapp.js index 5de3c2d..7badf0b 100644 --- a/diigo-cache/tests/fake-webapp.js +++ b/diigo-cache/tests/fake-webapp.js @@ -1,11 +1,4 @@ -/** - * @file a stand-in for webapp's `WebAppFactory` entrypoint, for tests: an - * auxiliary worker (plain JS — the vitest pool doesn't transform aux - * workers) serving diigo-shaped `load_user_items` pages. 250 items (3 - * pages of 100, the last short), every third private; a few webapp ids - * are known. Counts its diigo calls so tests - * can tell a cache hit (no call) from a miss. - */ +/** @file a stand-in for webapp's `WebAppFactory`, serving diigo-shaped pages to tests. */ import { RpcTarget, WorkerEntrypoint } from "cloudflare:workers"; const KNOWN_WEBAPP = "fake-webapp-id"; @@ -106,6 +99,12 @@ class FakeGet extends RpcTarget { } } +/** + * webapp's `WebAppFactory` entrypoint, faked: an auxiliary worker (plain + * JS; the vitest pool doesn't transform aux workers) serving + * `load_user_items` pages for a few known webapp ids. Counts its diigo + * calls, so tests can tell a cache hit (no call) from a miss. + */ export class WebAppFactory extends WorkerEntrypoint { async at(id) { const kind = { diff --git a/diigo-cache/tests/test-worker.ts b/diigo-cache/tests/test-worker.ts index f1ed024..59ce115 100644 --- a/diigo-cache/tests/test-worker.ts +++ b/diigo-cache/tests/test-worker.ts @@ -1,8 +1,4 @@ -/** - * @file the tests' main module — their edge: the real worker (whose own - * edge supplies the live clock), plus the private cache's logic on a fixed - * clock (bound as CLOCKED_DO in wrangler.tests.jsonc). - */ +/** @file the tests' main module: the real worker plus a fixed-clock cache. */ import { DiigoCacheLogic } from "../src/cache.js"; import type { CacheEnv } from "../src/cache.js"; @@ -13,7 +9,8 @@ export { default } from "../src/index.js"; * never due in real time — tests run it with runDurableObjectAlarm */ export const FIXED_NOW = Date.UTC(2099, 0, 1, 0, 0, 0); -/** a fixed clock that records each sleep it is asked for */ +/** the private cache's logic on a fixed clock that records each sleep it + * is asked for (bound as CLOCKED_DO in wrangler.tests.jsonc) */ export class FixedClockCache extends DiigoCacheLogic { #sleeps: number[] = [];