fix(indieauth,microsub,vc,conformance-target,examples): close LOW findings from issue #474 audit - #481
Conversation
…dings from issue #474 audit Closes the 7 remaining LOW-severity findings from the Workers-best-practices audit (issue #474); all HIGH/MEDIUM findings were already closed by #477. - indieauth: wrap route dispatch in try/catch (structured server_error instead of an unhandled crash); shape-guard the stored profile JSON before trusting it as ProfileInfo instead of blind-casting it. - microsub: background the follow poll-priming queue send via ctx.waitUntil instead of blocking the response. - vc: scope the signer cache to each createVc() instance instead of a module-level global shared across instances. - conformance-target: background the request-body-cancel floating promise via ctx.waitUntil; bump the ~19-month-stale compatibility_date. - examples/deploy-to-cloudflare: wrap routing dispatch in try/catch, since this starter file is copied wholesale into real deployed Workers. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
davidwkeith
left a comment
There was a problem hiding this comment.
Reviewed against CONTRIBUTING.md. Overall this is solid, low-risk hardening work — each fix is scoped to exactly what its changeset describes, and the return await fixes in indieauth/handler.ts and examples/deploy-to-cloudflare/src/index.ts are correct and necessary (without the explicit await, a rejection from the wrapped call would escape the enclosing try rather than being caught, since return promise inside a try doesn't implicitly await before leaving the block).
CONTRIBUTING.md conformance
- PR opened from the template with
Summary/Packages affected/Checklistheadings intact — good. - Checklist: unticked items ("spec update", "catalog/status.json") each carry the required one-line reason instead of being deleted — good.
- Changesets: present for all three publishable packages touched (
indieauth,microsub,vc);conformance-targetandexamples/deploy-to-cloudflareare correctly left out since both are private — good. - Commit/PR title:
fix(indieauth,microsub,vc,conformance-target,examples): …— lowercase type, no trailing period, comma-separated scopes. One minor nit: the scope convention is "package name minus the@dwk/prefix";conformance-targetmaps cleanly (@dwk/conformance-target), butexamplesdoesn't correspond to any@dwk/-prefixed package (the folder's ownpackage.jsonname isdwk-discovery-starter). Not worth blocking on — the meaning is still discoverable — but flagging in case the maintainer wants a more precise scope token for this repo's convention going forward.
Code — one inline suggestion
packages/microsub/src/handler.ts:353— the poll-priming queue send is now backgrounded viactx.waitUntilbut not.catch()'d, so a send failure is silently swallowed instead of logged (see inline comment for a concrete fix using theemitseam already used elsewhere in this handler). Not blocking.
Everything else — the indieauth shape guard (isProfileInfo), the per-instance vc signer cache, and the conformance-target wrangler.jsonc compatibility-date bump — looks correct and matches the composition contract's per-instance isolation rule. New tests look well-targeted (signer-cache isolation across two createVc() instances, malformed stored-profile shapes, the non-blocking follow-response test with an explicit waited array).
Note: CI (build-test, integration) was still in progress at review time — worth confirming green before merge.
Generated by Claude Code
…wing it Per review on #481: now that the send is backgrounded via ctx.waitUntil, a rejection (e.g. the queue is unavailable) would otherwise be silently swallowed instead of surfacing as it did when the send was awaited inline. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
commented
Aug 4, 2026
|
The Generated by Claude Code |
Summary
Closes #474. All HIGH and MEDIUM findings from the Workers-best-practices audit were already fixed by #477; this closes the 7 remaining LOW-severity findings:
createIndieAuth's route dispatch is now wrapped in try/catch — an unexpected exception (e.g. a D1 failure) returns a structuredserver_errorOAuth response instead of crashing unhandled. Also added a runtime shape guard (isProfileInfo) soparseProfileno longer blind-casts the storedprofileJSON column toProfileInfo.handleFollow's poll-primingMICROSUB_QUEUE.sendnow runs viactx.waitUntilinstead of blocking the HTTP response — it's a cache-priming nicety, not something the client needs to wait on.signerCache) is now scoped to eachcreateVc()instance instead of a module-level global, so independently configured instances in the same isolate no longer silently share cache state — matching the composition contract's "instantiate multiple times, tested in isolation" rule.request.body.cancel()floating promise infetch()is now backgrounded viactx.waitUntil;wrangler.jsonc'scompatibility_datebumped from2025-01-01(~19 months stale) to2026-07-01, matching the siblingexamples/deploy-to-cloudflare/wrangler.jsonc.fetch()routing dispatch is now wrapped in try/catch, since this file is copied wholesale into real deployed Workers (its own doc comment says as much) and previously had no crash guard at all.Also updated issue #474's checklist to reflect the already-merged HIGH/MEDIUM items from #477 and check off the LOW items closed here.
Packages affected
@dwk/indieauth, @dwk/microsub, @dwk/vc, @dwk/conformance-target (private, no changeset), examples/deploy-to-cloudflare (private, no changeset)
Checklist
spec/packages/and updated them ifbehaviour changed — not applicable, all changes are internal
robustness/isolation fixes with no observable protocol/behavior change
src/*.test.ts)pnpm lint && pnpm format:check && pnpm typecheck && pnpm build && pnpm testpnpm changeset) if this touches a publishablepackage
catalog.json/conformance/status.json— not applicable, no new mountable worker or conformance-status changeGenerated by Claude Code