fix(activity-feed): canonicalize contributor handle so profile links resolve #9
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/activity-feed-canonical-handle"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The activity feed was returning decorated strings like
Vida (self-directed)and@m3taversalin thecontributorfield. The frontend uses that field as both display label and routing handle, so/contributors/Vida%20(self-directed)404s — Next firesnotFound()in[handle]/page.tsx.Root cause
_normalize_contributoronly stripped@and whitespace; it did not lowercase or strip the(self-directed)suffix thatextract.pyand the olderbackfill_submitted_by.pywrote intoprs.submitted_by. Mixed-case agent names (Vida vs vida) and pipeline decorators (pipeline (reweave)) both fell through.Fix
Lowercase + strip any trailing parenthetical decorator. Valid handles match
^[a-z0-9][a-z0-9_-]{0,38}$perattribution._HANDLE_REand cannot contain parens, so the strip is lossless.Verification
Stack context
Part of a 3-PR set fixing timeline-page 404s end-to-end:
fix/canonicalize-submitted-by(sibling Forgejo PR): write-side fix inlib/extract.py+ historical backfill (3738 rows)living-ip/livingip-web#33: frontend contract docs + enforceable check scriptMerging this one alone resolves the live 404. The other two are durable guardrails so the contract can't quietly regress.
The activity feed was returning decorated strings like "Vida (self-directed)" and "@m3taversal" in the contributor field. The frontend uses that field as both display label and routing handle, so /contributors/Vida%20(self-directed) 404s — Next fires notFound() in [handle]/page.tsx. Root cause: _normalize_contributor only stripped @ and whitespace; it did not lowercase or strip the " (self-directed)" suffix that extract.py and the older backfill_submitted_by.py wrote into prs.submitted_by. Mixed-case agent names (Vida vs vida) and pipeline decorators ("pipeline (reweave)") both fell through. Fix: lowercase + strip any trailing parenthetical decorator. Valid handles match ^[a-z0-9][a-z0-9_-]{0,38}$ per attribution._HANDLE_RE and cannot contain parens, so the strip is lossless. DB simulation against 3612 merged-PR events: 0 orphan handles after normalization (was 12 orphan label-variants before). No KB writes — pure read-side normalization in the API layer.