Repository navigation
fix(api): permanent redirects for legacy-cased and re-punctuated handles - #198
Merged
Merged
Conversation
safeSlug's transform moves to @cfp/shared as normalizeLegacyHandle so the redirect layer can apply exactly what the import applied. The tag translator uses it too. Import output is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
laddr matched handles case-insensitively and the import normalized them, but lookups are exact-match, so links like /projects/Apps_for_Philly or /projects/sheldon.md 404ed. When a slug is neither live nor in slug-history, normalize it and redirect permanently if that resolves. Buzz's live check now uses buzzIdBySlug, and the legacy /project-buzz and /tags/<ns>.<slug> forms accept legacy casing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements
plans/legacy-handle-redirects.md. This PR is stacked on #196 (the spec and plan) and will retarget todevelopwhen #196 merges.Bug: laddr matched handles regardless of case, and the import lowercased and re-punctuated them (66 of 269 project handles changed). Lookups here are exact-match, so
/projects/Apps_for_Philly,/projects/sheldon.md,/members/Jane_Doeand similar links all 404 in production today.Fix:
normalizeLegacyHandlein@cfp/shared, shared by the importer and the redirect layer so the two can't drift. Import output is unchanged.slug-redirect: when a slug is neither live nor in slug-history, normalize it, and if the result is live (or resolves through slug-history), return a 301 with a one-day cache. These redirects never expire.buzzIdBySlug. The legacy/project-buzz/<slug>and/tags/<Ns>.<slug>forms now accept legacy casing.Validation: type-check, lint and the full suite all pass, including new unit tests and redirect tests. The production spot check over the 66 changed project handles has to wait until this is deployed.
🤖 Generated with Claude Code