Skip to content

User skills endpoint uncached, repeats D1 reads per request #186

Closed

Description

@harlan-github-agent

GET /api/users/:login/skills is a bare defineEventHandler with no cache, so each crawler hit repeats the same D1 reads and landed as SKILLD-1K in the D1 overload burst.

Target: server/api/users/[login]/skills.get.ts

Verify with: pnpm vitest run test/unit/user-skills-cache.test.ts

Estimated to change 2 files.

The sentry-checkin routine opened this issue automatically on its 2026-09-08T20:20:00.000Z run. It is not Harlan's own report. Close it to reject the proposal, and the reason you give stops it being offered again.

Activity

  1. harlan-github-agent commented on Sep 8, 2026

    @harlan-github-agent
    ContributorAuthor

    🤖 ISSUE TRIAGE

    Harlan Agent Kit posted this automated triage. It is not Harlan's personal assessment or commitment. AI open source policy.

    • Route: Ready to implement
    • Difficulty: 2/5
    • Impact: 3/5
    • Reproduction: Yes
    • Codebase review: Not needed
    • Summary: Target file exists and is confirmed uncached: server/api/users/[login]/skills.get.ts is a bare defineApiHandler running the per-login D1 query on every request. The repo already has the exact fix pattern: the skill detail route (layers/regi
    • Next action: Implement in server/api/users/[login]/skills.get.ts: wrap the D1 query in cached({ storage: useStorage('cache'), key: user-skills:${login.toLowerCase()}, ttlSeconds: 60, staleSeconds: 300, compute, schedule: promise => runAfterResponse(event, promise) }) following the skills detail route pattern, write the failing test first at test/unit/user-skills-cache.test.ts, verify with pnpm vitest run test/unit/user-skills-cache.test.ts.
    • Fix with: Org profile endpoint runs uncached D1 queries per request #183
  2. added
    harlan-agent-ready-to-implementIssue triage found bounded work ready for an implementation Agent.
    harlan-agent-runningAn Agent holds a Task on this issue or pull request right now.
    and removed
    harlan-agent-runningAn Agent holds a Task on this issue or pull request right now.
    on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions