Skip to content

fix(registry): stop a KV outage 500ing every /gh page - #40

Merged
harlan-zw merged 1 commit into
mainfrom
fix/sentry-checkin-20260819-skilld
Aug 19, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/sentry-checkin-20260819-skilld

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

❓ Type of change

  • 🐞 Bug fix

📚 Description

Sentry check-in of the skilld project. Seven of the eight open issues were already closed by earlier commits; this is the one gap left.

skill-source-gone middleware runs on every /gh request and read its key set with a bare useStorage('cache').getItem. Workers KV answered one of those with:

Error: KV GET failed: 500 Internal Server Error
  GET /api/skill-related/dylantarre/animation-principles/educator-teacher
  url https://skilld.dev/gh/dylantarre/animation-principles/educator-teacher

acbd24c moved the skill-related reads onto readCache, but this one was on the same request and stayed bare. The D1 fallback under it could fail the same way, and did elsewhere as D1_RESET_DO.

resolveGoneSkillKeys now returns string[] | null and the middleware only sets 410 on a resolved set. The cost of an unresolved lookup is one stale 200 on a deleted skill until the next request. The cost of the old behaviour was the page.

One thing I went back and forth on: during a KV outage the fallback puts a D1 query back on the hot /gh path, which is the thing the cache is there to prevent. It is capped by the same failure that caused it, and 410-vs-200 is not worth a second cache layer, so I left it.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

The gone-skill middleware read its key set with a bare
`useStorage('cache').getItem`, so `KV GET failed: 500 Internal Server
Error` travelled out of the read-through cache and failed the request
(Sentry SKILLD-S). The D1 fallback behind it could fail the same way.

`resolveGoneSkillKeys` answers null when neither store can be reached,
and the middleware leaves the response status alone. A middleware whose
only job is upgrading 200 to 410 should never be why a page fails.
@harlan-zw
harlan-zw merged commit 04dc7c7 into main Aug 19, 2026
7 of 8 checks passed
@harlan-zw
harlan-zw deleted the fix/sentry-checkin-20260819-skilld branch August 19, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant