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
Routes every URL-reachable decodeURIComponent call in apps/web and
packages/ through one shared, guarded helper instead of leaving each
call site to throw on a malformed percent-escape:
- New leaf package @corbits/url-path (no deps, safe in the browser
bundle and hub code alike) holding decodedOrNull —
packages/artifact-ui, packages/chat, and apps/hub can't depend on
apps/web, so the helper can't stay local to path-ids.ts.
- apps/web/src/path-ids.ts imports it instead of keeping its own copy.
- apps/web/src/workbench-path.ts: workbenchIdFromPath,
workbenchSettingsSectionFromPath (now also validated against
WorkbenchSettingsSectionId via the new isWorkbenchSettingsSectionId,
replacing the unchecked `as` cast — packages/chat-ui exports both
the guard and its backing WORKBENCH_SETTINGS_SECTION_IDS list),
workbenchSettingsEntityIdFromPath.
- apps/web/src/insights-path.ts (moved out of the 1700-line
insights-page.tsx, which now just imports it): parseInsightsPath's
workbenchId/runId. A malformed escape now falls all the way back to
{mode: "landing"} — returning {mode: "workbench", workbenchId:
null} would render a bench-scoped dashboard mislabeled "All
workbenches" with permanently-empty panels instead of the plain
landing view every other unresolvable path already gets.
- packages/artifact-ui/src/kind-filter.ts: libraryArtifactIdFromPath.
- packages/chat/src/routes.ts: DELETE .../participants/:address now
400s on a malformed address instead of throwing mid-request.
- apps/hub/src/index.ts's createStaticHandler (exported for the new
test): the SPA static-file fallback ahead of every non-/api route,
reachable unauthenticated — GET /%zz threw a 500 before this;
now falls through to the platform's own 404 like any other
unresolvable path.
packages/connections/src/oauth-routes.ts's decode was already
try/caught and is left as-is. Not in scope: apps/hub's
dbConfigFromUrl decodes a database URL's own user/password at boot —
operator-supplied config, never a client-reachable URL, so it's
noted here rather than guarded (its shape is mirrored by six test
doubles across apps/hub, packages/insights, packages/inbox, and
packages/approvals, none of them production code either).
Claude-Session: https://claude.ai/code/session_01Shhie5zM8L54bLHq5gFQti
0 commit comments