You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
projector: read/reconcile routes return unstructured 500s on store or runtime failures #10540
Most pm-stack/projector HTTP routes let store, git, or reconcile exceptions propagate out of handleRequest, so a runtime failure becomes an unhandled fetch rejection and a framework-default 500 response with no JSON error body. This is inconsistent with the service's own /health and /github/webhook paths, which catch failures and return structured JSON responses.
POST /github/webhook validates input, guards apply/publish, records outcomes, and returns structured 4xx/5xx JSON on failures: L297-358.
Other routes do not guard store/runtime calls:
GET /items: L305-322 calls store.getItems / store.listItems without try/catch.
GET /comments: L325-340 calls store.getCommentsForSubject / store.getComments without try/catch.
GET /links: L346-351 calls store.getLinks without try/catch.
DELETE /links: L395-399 calls store.deleteLink without try/catch (POST's upsertLink is separately guarded at L384-388).
GET /subjects/*: L418-431 calls store.getSubject without try/catch.
GET /hot: L444-456 calls store.hotHighWater / store.listHotEvents without try/catch.
GET /hot/checkpoints: L458-463 calls store.getConsumerCheckpoint without try/catch.
POST /reconcile: L500-504 calls reconcileRepos(...) without try/catch.
serve() returns handleRequest(...) directly (L603-615), so thrown/rejected errors are not normalized into the service's jsonResponse shape.
Why it matters
Projector is an internal API consumed by other PM-stack components and operational tooling. DB contention/corruption, bad state, or reconcile failures can produce opaque/non-JSON 500s that are harder for clients and monitors to interpret than a consistent { "error": ... } response.
Suggested fix shape
Add a consistent error boundary for route handlers (or a top-level catch around handleRequest/serve fetch) that logs the failure and returns a structured JSON 5xx (e.g. jsonResponse(500, { error: ... })), while preserving existing specific status codes where already intentional. Keep the webhook's current semantics where appropriate.
Issue projector: read/reconcile routes return unstructured 500s on store or runtime failures #10540 is CLOSED (status:done). Fresh verification on origin/main (2026-11-17): commit 5757dba ("projector: answer unhandled route errors with a JSON 500", 2026-11-17) implements the issue's suggested fix shape — pm-stack/projector/src/server.ts now documents and installs "the service's error boundary (projector: read/reconcile routes return unstructured 500s on store or runtime failures #10540): every route answers JSON" (L247–271): handleRequest catches route failures and returns jsonResponse(500, { error: "internal_error", message }) instead of leaking a framework-default 500. The previously unguarded routes (/items, /comments, /links, /subjects/*, /hot, /reconcile) are all behind that boundary.
No follow-on needed; triage completes as already_done.
Activity
developing-today commentedon Nov 15, 2026
CODE-3824
dezren39 commentedon Nov 17, 2026
🤖 Agent note · verified already done — task 19321 (lane code-a)
pm-stack/projector/src/server.tsnow documents and installs "the service's error boundary (projector: read/reconcile routes return unstructured 500s on store or runtime failures #10540): every route answers JSON" (L247–271):handleRequestcatches route failures and returnsjsonResponse(500, { error: "internal_error", message })instead of leaking a framework-default 500. The previously unguarded routes (/items, /comments, /links, /subjects/*, /hot, /reconcile) are all behind that boundary.dezren39 commentedon Nov 18, 2026
state: verified_closed / already_done
task: 20652 (repo-health-code-pilot, lane oc-code-03)
issue: #10540 — projector: read/reconcile routes return unstructured 500s
Fresh check 2026-11-18: issue CLOSED (closed 2026-11-17T02:13:20Z). Commit 5757dba (projector: answer unhandled route errors with a JSON 500) is on origin/main; pm-stack/projector/src/server.ts handleRequest returns a JSON internal_error 500.
Disposition: already_done, no follow-on.