Context
Found in team:engine release testing of the Portal (apps/portal), 2026-10-20, in headless Chrome against the dev server on origin/dev 4844087a77. In learn/blog/the-organism-already-existed.md, the link [… Discussion #14422](https://github.com/orgs/neomjs/discussions/14422) renders as two links. The second, #14422, opens #/news/tickets/14422. That view then fetched 47 ticket chunks one after another in 25 s and showed nothing; it was still fetching when the run stopped. A known ticket such as #10074 takes 3 requests. Reproduced 2/2.
The Problem
Two defects meet on one click:
- The ticket autolink rewrites ids inside links that already exist. It counts 18 such links in 5 files, 16 of which point at PRs or Discussions, so the rewritten link opens the wrong view.
- An id the tickets index lacks makes the view walk every chunk folder. There are about 1,061, which is roughly nine minutes at the rate observed. The same happens for any unknown id typed into the URL.
The Architectural Reality
src/component/Markdown.mjs: regexTicketId = /(^|[\s(])#(\d+)\b/g is replaced in the raw Markdown before it renders (step 3 of the content pass). Fenced and inline code are protected first, but existing links are not, so [PR #14458](url) becomes [PR <a href="…/14458">#14458</a>](url).
apps/portal/view/news/tickets/MainContainerController.mjs#ensureRecordLoaded: when the id map names a chunk, one targeted load happens. When it doesn't, the method falls back to for (…folders) await tree.onFolderItemClick(folder) across every unloaded folder.
- Design authority:
ensureRecordLoaded's own comment says the build-emitted id map "names the chunk folder containing the item, so one targeted load replaces the sequential scan". An id absent from a loaded id map is therefore not a ticket. The sequential scan remains only for a missing map.
The Fix
Markdown.mjs: protect Markdown links ([text](url)) the way inline code is protected before the ticket replacement, so an id inside a link's text or URL stays as written.
ensureRecordLoaded: when the id map loaded and has no entry for the id, return null without scanning. Keep the sequential scan only for when the map is unavailable.
Acceptance Criteria
Out of Scope
- Making the tickets view say "not found" in words. The empty state is enough for this ticket.
- The blog's relative links, filed separately.
Related
- #8398 (the ticket mirroring epic), and
learn/blog/the-organism-already-existed.md (the reproducer).
Live latest-open sweep: checked the latest 20 open issues at 2026-10-20T11:12Z, and open-issue searches for "ticket id markdown link" and "tickets chunk load unknown id": no equivalent.
MC sweep: one query on these nouns, 6 results, no prior decision. Clio's 10-16 note on the dark sitemap routes concerns deploying, not this.
Own-assignment sweep: none overlapping.
Origin Session ID: ad84dc14-8baf-4f95-a7dd-a9e224f51c31
Retrieval Hint: "Portal tickets view loads every chunk for an unknown id; Markdown ticket autolink inside link text"
Context
Found in team:engine release testing of the Portal (
apps/portal), 2026-10-20, in headless Chrome against the dev server onorigin/dev4844087a77. Inlearn/blog/the-organism-already-existed.md, the link[… Discussion #14422](https://github.com/orgs/neomjs/discussions/14422)renders as two links. The second,#14422, opens#/news/tickets/14422. That view then fetched 47 ticket chunks one after another in 25 s and showed nothing; it was still fetching when the run stopped. A known ticket such as#10074takes 3 requests. Reproduced 2/2.The Problem
Two defects meet on one click:
The Architectural Reality
src/component/Markdown.mjs:regexTicketId = /(^|[\s(])#(\d+)\b/gis replaced in the raw Markdown before it renders (step 3 of the content pass). Fenced and inline code are protected first, but existing links are not, so[PR #14458](url)becomes[PR <a href="…/14458">#14458</a>](url).apps/portal/view/news/tickets/MainContainerController.mjs#ensureRecordLoaded: when the id map names a chunk, one targeted load happens. When it doesn't, the method falls back tofor (…folders) await tree.onFolderItemClick(folder)across every unloaded folder.ensureRecordLoaded's own comment says the build-emitted id map "names the chunk folder containing the item, so one targeted load replaces the sequential scan". An id absent from a loaded id map is therefore not a ticket. The sequential scan remains only for a missing map.The Fix
Markdown.mjs: protect Markdown links ([text](url)) the way inline code is protected before the ticket replacement, so an id inside a link's text or URL stays as written.ensureRecordLoaded: when the id map loaded and has no entry for the id, returnnullwithout scanning. Keep the sequential scan only for when the map is unavailable.Acceptance Criteria
[PR #14458](https://example.com/14458)renders exactly one anchor, and its href is the original URL. A bare#14458in prose still becomes a ticket link.ensureRecordLoadedfor an id absent from a loaded id map loads no folder and returnsnull. An id present in the map still loads its one chunk.#Nlink that points at a PR or Discussion opens that URL, and#/news/tickets/<unknown id>settles to the view's empty state without fetching chunks.Out of Scope
Related
learn/blog/the-organism-already-existed.md(the reproducer).Live latest-open sweep: checked the latest 20 open issues at 2026-10-20T11:12Z, and open-issue searches for "ticket id markdown link" and "tickets chunk load unknown id": no equivalent. MC sweep: one query on these nouns, 6 results, no prior decision. Clio's 10-16 note on the dark sitemap routes concerns deploying, not this. Own-assignment sweep: none overlapping.
Origin Session ID: ad84dc14-8baf-4f95-a7dd-a9e224f51c31 Retrieval Hint: "Portal tickets view loads every chunk for an unknown id; Markdown ticket autolink inside link text"