Skip to content

Fix broken sidebar links for chained class aliases#1675

Draft
st0012 wants to merge 1 commit intomasterfrom
fix-chained-alias-nav-link
Draft

Fix broken sidebar links for chained class aliases#1675
st0012 wants to merge 1 commit intomasterfrom
fix-chained-alias-nav-link

Conversation

@st0012
Copy link
Copy Markdown
Member

@st0012 st0012 commented Apr 6, 2026

Summary

  • Fixes broken sidebar links when class aliases chain through other aliases (e.g., HTTPRequestURITooLarge = HTTPRequestURITooLong = HTTPURITooLong in net/http)
  • The outermost alias's sidebar link pointed to the intermediate alias's HTML file, which is never generated since aliases don't get their own pages
  • Resolve the alias chain in update_aliases by looking up the current store entry to follow already-processed aliases back to the real class
  • Also make name_for_path follow the chain recursively as a defensive measure

Fixes #1664

When Ruby defines chained aliases like `A = B = C` (e.g.,
`HTTPRequestURITooLarge = HTTPRequestURITooLong = HTTPURITooLong`
in net/http), the sidebar link for the outermost alias pointed to
the intermediate alias's HTML file, which is never generated.

The root cause: `update_aliases` creates ClassModule objects whose
`is_alias_for` references stale intermediate objects from
`add_module_alias` that don't know they are aliases. Resolve through
the store to follow already-processed aliases back to the real class.

Also make `name_for_path` follow the alias chain recursively as a
defensive measure.

Fixes #1664.
@matzbot
Copy link
Copy Markdown
Collaborator

matzbot commented Apr 6, 2026

🚀 Preview deployment available at: https://2ee5894b.rdoc-6cd.pages.dev (commit: 9e7ccd1)

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.

Broken link in class nav

2 participants