Skip to content

Redirect merged author pages to the author they were merged into - #869

Merged
NielsRogge merged 1 commit into
mainfrom
claude/author-alias-redirect
Nov 3, 2026
Merged

NielsRogge merged 1 commit into
mainfrom
claude/author-alias-redirect

Conversation

@NielsRogge

@NielsRogge NielsRogge commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Why

/authors/251936 shows "Page not found". It is one of the paper-less author rows deleted in #868 and aliased in author_aliases to /authors/181986 (Vik Paruchuri). The authors API already resolves aliases, but the server-rendered /authors/{id} page reads authors directly and never checks them.

What

  • New merged_author_id(db, author_id) helper in author_service. AuthorService._resolve_author_id now uses it too.
  • author_page returns a 301 redirect from a merged ID to /authors/<surviving id>, keeping the query string. This check runs before the existing redirect for authors that are organizations.

Validation

  • uv run pytest backend/tests/test_search_discovery.py backend/tests/test_authors_api.py: 71 passed, including a new test for the alias redirect.
  • ruff is clean.

🤖 Generated with Claude Code


Note

Low Risk
Read-only redirect and alias lookup on public discovery routes; behavior mirrors existing API resolution with no data or auth changes.

Overview
Server-rendered /authors/{id} routes now treat author_aliases like the authors API: merged (deleted) IDs no longer 404 when they still appear in links or bookmarks.

A shared merged_author_id helper in author_service looks up the surviving author ID; AuthorService._resolve_author_id uses it instead of duplicating the query. On author_page, a 301 to /authors/<surviving id> runs before the existing org-name redirect, and query strings are preserved. Tests cover the new redirect and stub merged_author_id where author routes are exercised without hitting the DB.

Reviewed by Cursor Bugbot for commit 62026ae. Bugbot is set up for automated code reviews on this repo. Configure here.

/authors/<id> is rendered server-side straight from the authors table, so
an author ID merged away through author_aliases (e.g. /authors/251936 into
/authors/181986) returned "Page not found", although the authors API
already resolves aliases. The page route now 301-redirects a merged ID to
the surviving author, keeping the query string, before the organization
redirect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NielsRogge
NielsRogge merged commit 3e9caf8 into main Nov 3, 2026
5 checks passed
@NielsRogge
NielsRogge deleted the claude/author-alias-redirect branch November 3, 2026 10:19
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