Problem
`src/utils/cache.ts:94,101` does fire-and-forget KV deletes:
```ts
this.kv.delete(cacheKey).catch(console.error)
```
In Cloudflare Workers, any pending promise that isn't awaited or registered with `ctx.waitUntil()` can be cancelled when the request handler returns. So the delete might fire, or the runtime might tear down the isolate first.
Fix
Pass an `ExecutionContext` (or `waitUntil`-callable surface) into the cache layer and wrap both deletes:
```ts
ctx.waitUntil(this.kv.delete(cacheKey))
```
Both call sites are in the cache invalidation path (deleting stale entries on read), so the visible symptom of dropped deletes is stale cache hits — silent and rare.
Scope
- ~5 LOC change in `src/utils/cache.ts`
- Whatever plumbing is needed to thread `ctx` through to the cache instance — likely the cached-client constructor or a per-request setter
Cost if unfixed
Stale cache entries linger past their intended invalidation. Low blast radius (cache layer, not data integrity), but it's a known Workers footgun and the fix is small.
Source: this repo's CLAUDE.md calls out `waitUntil`-style patterns; `workers-best-practices` flags raw `.catch()` on background work as an anti-pattern.
Problem
`src/utils/cache.ts:94,101` does fire-and-forget KV deletes:
```ts
this.kv.delete(cacheKey).catch(console.error)
```
In Cloudflare Workers, any pending promise that isn't awaited or registered with `ctx.waitUntil()` can be cancelled when the request handler returns. So the delete might fire, or the runtime might tear down the isolate first.
Fix
Pass an `ExecutionContext` (or `waitUntil`-callable surface) into the cache layer and wrap both deletes:
```ts
ctx.waitUntil(this.kv.delete(cacheKey))
```
Both call sites are in the cache invalidation path (deleting stale entries on read), so the visible symptom of dropped deletes is stale cache hits — silent and rare.
Scope
Cost if unfixed
Stale cache entries linger past their intended invalidation. Low blast radius (cache layer, not data integrity), but it's a known Workers footgun and the fix is small.
Source: this repo's CLAUDE.md calls out `waitUntil`-style patterns; `workers-best-practices` flags raw `.catch()` on background work as an anti-pattern.