Closed bug report

Issue numbers are global, not per-page

Colby Knox · 6d ago ·closed by Colby Knox

Issue ids in URLs and the API are a single global sequence across every page on the wiki, not a per-page counter. Example from this very page: the 'Show multiple authors (collaborators) on component pages' thread displays as #31 (31st issue on adom/wiki) but its URL is /adom/wiki/issues/119, because 119 is the global discussions rowid.

Why this is bad:

  • The number people see and the number in the URL disagree. 'Issue #31' is not reachable at /issues/31 on the page it belongs to (that URL is some other page's thread or a 404 gated by visibility checks).
  • Cross-references are ambiguous and fragile. '#119' means nothing on a page where you only ever saw 31 issues, and pasting an id into the wrong page's URL pattern silently resolves to a different page's thread.
  • The displayed per-page number is computed at read time (COUNT of discussions on the page with id <= this one), so it is not stored anywhere, cannot be queried by, and is not guaranteed stable.
  • URLs leak the global issue volume of the whole wiki, and every other forge (GitHub, GitLab, Gitea) trained everyone that issue numbers are per-repo.

Proposal:

  • Add a stored per-page number column to discussions, assigned at create time (max+1 per page inside the insert transaction), with a unique index on (page_id, number).
  • Backfill existing rows in id order per page (matching the numbers already displayed today, so nothing renumbers).
  • Route /:owner/:slug/issues/:number on the per-page number. Keep the global id for internal API use, and redirect or fall back for old global-id URLs where they do not collide with a per-page number.
  • Same treatment applies to PRs if their ids share the pattern.

0 Replies

Log in to reply.