Skip to content

fix(api): permanent redirects for legacy-cased and re-punctuated handles - #198

Merged
themightychris merged 3 commits into
developfrom
fix/legacy-handle-redirects
Oct 14, 2026
Merged

themightychris merged 3 commits into
developfrom
fix/legacy-handle-redirects

Conversation

@themightychris

Copy link
Copy Markdown
Member

Implements plans/legacy-handle-redirects.md. This PR is stacked on #196 (the spec and plan) and will retarget to develop when #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_Doe and similar links all 404 in production today.

Fix:

  • A new normalizeLegacyHandle in @cfp/shared, shared by the importer and the redirect layer so the two can't drift. Import output is unchanged.
  • In 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.
  • Buzz's "live" check now uses 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

themightychris and others added 3 commits October 13, 2026 20:06
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>
Base automatically changed from chore/gitsheets-freshness to develop October 14, 2026 02:39
@themightychris
themightychris merged commit 825ebb3 into develop Oct 14, 2026
1 check passed
@themightychris
themightychris deleted the fix/legacy-handle-redirects branch October 14, 2026 02:40
@themightychris themightychris mentioned this pull request Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant