Reject unresolved showcase route placeholders#105
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9db69bebb6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (typeof value !== "string" || hasUnresolvedRoutePlaceholder(value)) { | ||
| return null; | ||
| } |
There was a problem hiding this comment.
Clear unsafe ready-state links instead of preserving them
When a ready status payload contains a placeholder URL while the job already has a stored preview/demo URL (for example from localStorage or an earlier event before this guard), this returns null the same way a missing field does. buildPayloadLocationPatch does not clear missing links for status === "ready", so the terminal patch passes undefined and the reducer preserves the existing unsafe URL, leaving the placeholder link clickable despite the new rejection path. Distinguish unsafe values from absent values or explicitly clear unsafe links for ready payloads.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 79f2154: ready status payloads now explicitly clear unsafe placeholder preview and dashboard URLs instead of preserving stale stored links.
| @@ -0,0 +1,5 @@ | |||
| const UNRESOLVED_ROUTE_PLACEHOLDER_RE = /[{}]|%7b|%7d/i; | |||
There was a problem hiding this comment.
Limit placeholder rejection to route tokens
This helper treats any brace or %7B/%7D in a URL as an unresolved route placeholder, so valid source pages with encoded structured query state such as /search?state=%7B...%7D are now rejected by the create proxy and dashboard source URL validation. The route placeholder contract in this repo is specifically the {lang} routing token, so this should match that token (and its encoded form) rather than every literal/encoded brace.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 79f2154: unresolved route detection now matches the {lang} route token only, so encoded structured query state is no longer rejected.
Summary
{lang}/%7Blang%7Dplaceholders into backend route creation or rendered preview metadata.Testing
corepack pnpm test- 116 files, 686 tests passed.corepack pnpm checkcorepack pnpm test:contracts- 5 files, 30 tests passed.WEBLINGO_REPO_PATH=/Users/francoisgueguen/Documents/workspaces-self/saas/weblingo_showcase_route_hygiene_v2_backend corepack pnpm docs:sync:checkWEBLINGO_REPO_PATH=/Users/francoisgueguen/Documents/workspaces-self/saas/weblingo_showcase_route_hygiene_v2_backend corepack pnpm docs:syncDocs sync and capability matrix
WEBLINGO_REPO_PATH=/Users/francoisgueguen/Documents/workspaces-self/saas/weblingo_showcase_route_hygiene_v2_backend corepack pnpm docs:syncand committedcontent/docs/_generated/backend-sync-manifest.json.docs/backend/DASHBOARD_SPECS.mdnot updated; no user-facing backend dashboard capability coverage changed in the website repo.