Skip to content

Give non-latin names their own URL, and stop caching under test - #70

Merged
lbesecker195 merged 1 commit into
mainfrom
fix/non-latin-slugs
Sep 24, 2026
Merged

lbesecker195 merged 1 commit into
mainfrom
fix/non-latin-slugs

Conversation

@lbesecker195

Copy link
Copy Markdown
Owner

Closes #69.

Capability.slug/1 collapses everything outside [a-z0-9], so a name written entirely in a script with no latin characters reduced to nothing and fell back to the literal "item". 192 of the catalogue's 21,837 prompts and resources are such names — on any server holding more than one, only the first was reachable and the rest were URLs in the sitemap that could not be opened.

They now fall back to a short stable hash of the name. An unlovely URL, but a working one, and the page still displays the name exactly as its publisher wrote it. :erlang.phash2/1 rather than phash/2, because it is specified to be portable — a URL minted today has to resolve tomorrow.

Cache off under test

One run failed and would not reproduce. McpRegistry.Cache is a global ETS table while async: true tests each hold their own database sandbox, so one test can be handed a value computed from rows it cannot see. Now that chunk contents are cached and not just counts, that stopped being theoretical.

Caching a count nobody is measuring buys nothing under test, so config/test.exs turns it off. Three seeds clean since.

Tests: 169 passing.


Pages affected:

🤖 Generated with Claude Code

A name written entirely in a script with no latin characters reduced to
nothing and fell back to the literal "item". 192 of the catalogue's 21,837
prompts and resources are such names, so on any server holding more than
one of them only the first was reachable and the rest were pages in the
sitemap that could not be opened.

They now fall back to a short stable hash of the name. An unlovely URL, but
a working one, and the page still shows the name as its publisher wrote it.
phash2 rather than phash, because it is specified to be portable -- a URL
minted today has to resolve tomorrow.

The cache is also off under test. It is a global ETS table while async
tests each hold their own database sandbox, so one test can be handed a
value computed from rows it cannot see; that produced one failure here that
would not reproduce. Three seeds clean since.

Closes #69

---

Pages affected:

- [MCP Harbor](https://ai.mcpharbor.dev/) -- registry home, search and recently added servers.
- [MCP server directory](https://ai.mcpharbor.dev/servers) -- the listings these pages hang under.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lbesecker195
lbesecker195 merged commit 8755a09 into main Sep 24, 2026
1 check passed
@lbesecker195
lbesecker195 deleted the fix/non-latin-slugs branch September 24, 2026 21:40
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.

Non-latin prompt and resource names share one URL

1 participant