Title: projector(subjects): GET /subjects/
Open Graph Title: projector(subjects): GET /subjects/
X Title: projector(subjects): GET /subjects/
Description: Problem The projector's joined-subject read endpoint throws on a malformed percent-encoding instead of answering with a clean error (main b3f6d2b): pm-stack/projector/src/server.ts:175-176 if (path.startsWith("/subjects/") && method === ...
Open Graph Description: Problem The projector's joined-subject read endpoint throws on a malformed percent-encoding instead of answering with a clean error (main b3f6d2b): pm-stack/projector/src/server.ts:175-176 if (path...
X Description: Problem The projector's joined-subject read endpoint throws on a malformed percent-encoding instead of answering with a clean error (main b3f6d2b): pm-stack/projector/src/server.ts:175-176 if (...
Opengraph URL: https://github.com/developing-today/code/issues/2693
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"projector(subjects): GET /subjects/\u003cmalformed percent-encoding> throws a raw URIError out of the handler — 500 instead of 400/404","articleBody":"## Problem\n\nThe projector's joined-subject read endpoint throws on a malformed percent-encoding instead of answering with a clean error (main b3f6d2b2):\n\n**`pm-stack/projector/src/server.ts:175-176`**\n```ts\nif (path.startsWith(\"/subjects/\") && method === \"GET\") {\n const subject = decodeURIComponent(path.slice(\"/subjects/\".length));\n```\n\n`decodeURIComponent` is unguarded, and this handler has no try/catch (unlike `/health` and the webhook path in the same file). A subject containing an incomplete UTF-8 percent sequence (`%E0%A4%A`) or a non-hex escape (`%zz`) raises a raw `URIError` that escapes `handleRequest` entirely — under `Bun.serve` the request fails as an unhandled 500 with no JSON error body, instead of the endpoint's own `404 {\"error\":\"subject_not_found\"}` or a 400 naming the bad encoding.\n\nSubjects are external keys (`kaneo:\u003cprojectSlug>/\u003ctaskId>`, `grist:\u003cdocId>/\u003ctableId>/\u003crowId>`, `gh:\u003cref>` — schema.sql), i.e. caller-supplied strings interpolated into a URL path by the aggregator and other clients, so a malformed or hand-built link reaches this code as-is.\n\n## Evidence (verified this run)\n\nProbe on the laptop (`~/git/fleet/probe-2026-10-30-laneB-projector/probe.ts`, real `handleRequest` + `migrate` against an in-memory libSQL DB, main b3f6d2b2):\n\n```text\nGET /subjects/%E0%A4%A -> THREW URIError: URI error\nGET /subjects/%zz -> THREW URIError: URI error\nGET /subjects/valid%20name -> status 404 body {\"error\":\"subject_not_found\"}\nGET /subjects/plain -> status 404 body {\"error\":\"subject_not_found\"}\n```\n\nWell-formed encodings decode and 404 cleanly; only the malformed forms escape the handler as a thrown exception.\n\n## Why it matters\n\nThis is the projector's one joined read (links + item state + unified activity in one call — aggregator requirement #1 + #2). Any client that builds the path from an untrusted or hand-edited subject gets an opaque server error with no JSON body to handle, and the throw lands in the server log as an unhandled exception rather than a client error. Every other structured input on this server is validated at the boundary (webhook HMAC + bounded body, link `ref` regex); this decode is the loose one.\n\n## Acceptance criteria\n\n- [ ] `GET /subjects/\u003cmalformed percent-encoding>` (e.g. `%E0%A4%A`, `%zz`, a trailing `%`) returns a JSON 400 (or the endpoint's 404) — `handleRequest` never throws for any path input.\n- [ ] Well-formed subjects are unchanged: an existing subject still returns 200 with its view, an unknown one still returns `404 {\"error\":\"subject_not_found\"}`.\n- [ ] A handler-level test pins the malformed forms alongside the well-formed control cases.\n\nDistinct from #2633 (the same defect family in lab-ops-hub's file route — different app, different handler) and from #1547 (projector read-API `limit` validation; its acceptance criteria cover only the limit parameter).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-30T10:55:53Z","url":"https://github.com/developing-today/code/issues/2693"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1c53ee3c-5da7-d9b6-436a-807c59b6d3ca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9BBA:34F10E:8085DA:AB8ECB:6B062FC0 |
| html-safe-nonce | 836a1a1e9057e1e4b9722edd3e2bd763af8440befa0e27572d9e8541434f633f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkJBOjM0RjEwRTo4MDg1REE6QUI4RUNCOjZCMDYyRkMwIiwidmlzaXRvcl9pZCI6IjY4ODM2OTIwMTQzNTgzNzYzODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ef03f3c399ba506beafb8bc1ff272de28707ce0dabbef5da13a5f9010d75f69b |
| hovercard-subject-tag | issue:6117743444 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/2693/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2713228435a94f2ee72cc2845ba1df4003cf972a1c0e0f89213478d8cd4308e7/developing-today/code/issues/2693 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2713228435a94f2ee72cc2845ba1df4003cf972a1c0e0f89213478d8cd4308e7/developing-today/code/issues/2693 |
| og:image:alt | Problem The projector's joined-subject read endpoint throws on a malformed percent-encoding instead of answering with a clean error (main b3f6d2b): pm-stack/projector/src/server.ts:175-176 if (path... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 494ea0bb1e0feef734a83e2628697647755e8864 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width