Skip to content

List a game's declared hostname first, then names, then IP literals - #229

Merged
HarryCordewener merged 1 commit into
mainfrom
claude/project-thread-f12d6m
Dec 2, 2026
Merged

HarryCordewener merged 1 commit into
mainfrom
claude/project-thread-f12d6m

Conversation

@HarryCordewener

@HarryCordewener HarryCordewener commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Requested by Grave · project thread

Why

/g/sharpmush-community lists 82.197.66.125 4201 above telnet.sharpmush.com 4201. The IP is a real endpoint: Intermud-3 seeded the address (the router records where a mud connects from, not a name), the crawl probed it, and IdentityMatcher.ResolvesToKnownEndpointAsync attached it to the game because telnet.sharpmush.com resolves to it. The change feed shows it recorded on 2026-12-01 02:47 UTC. NpgsqlEndpointStore sorts by host, port, so the digit came first, and the page, the API, PlainText, the preview card and the telnet:// in the structured data all read that order.

What

  • EndpointOrder.Sort: the winning HOSTNAME field first, other names next, IP literals last, then host and port. Applied once in NpgsqlGameQueries.PageAsync, so every surface built from GamePage gets it.
  • Game.razor sorted by IsCurrent and then by port, which would have put the 443 WebSocket ahead and undone the ranking. It now keeps the catalogue's order within the current and former groups.
  • Nothing is hidden or deleted. The IP stays listed, last.

Not changed: I3Cycle still seeds the IP. Its remarks rule out resolving names there, and the IP did answer as this game, so the row is a measurement. Deduplicating it would be a separate decision.

Tests

EndpointOrderTests (11 cases). Catalog and Web suites pass locally; the Postgres-backed tests skipped here and run in CI.


Generated by Claude Code

Summary by CodeRabbit

  • Improvements
    • Game endpoint lists now show the declared hostname first, followed by other hostnames and then IP addresses. When no declared hostname is available, hostnames appear before IP addresses.
    • Endpoints for the same host are ordered by port. Current endpoints continue to appear before former endpoints.

sharpmush-community led its page, API and structured data with
82.197.66.125 4201 above telnet.sharpmush.com 4201. The IP is a real,
measured endpoint: Intermud-3 seeded it (the router records the address
a mud connects from), the crawl probed it, and IdentityMatcher attached
it to the game because telnet.sharpmush.com resolves to it. Endpoints
were sorted by host, so a digit came first.

EndpointOrder now ranks the MSSP HOSTNAME winner first, other names
next, IP literals last, then host and port. The game page kept a
ThenBy(Port) after IsCurrent that would have undone it; it now keeps the
catalogue's order within each group. Nothing is hidden or deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rqqt7TscThm4HRMFznnYuk
@HarryCordewener HarryCordewener self-assigned this Dec 2, 2026
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The catalogue now sorts game endpoints using the declared hostname and address type, then host and port. Game pages use this order and preserve it within current and former endpoint groups.

Changes

Game endpoint ordering

Layer / File(s) Summary
Endpoint sorting and validation
src/MUI.Catalog/Games/EndpointOrder.cs, tests/MUI.Catalog.Tests/Games/EndpointOrderTests.cs
EndpointOrder.Sort prioritizes a matching declared hostname, then other hostnames, then IP literals. It sorts ties by case-insensitive host and port. Tests cover hostname matching, address literals, and port ordering.
Game page ordering
src/MUI.Catalog/Persistence/Queries/NpgsqlGameQueries.GamePage.cs, src/MUI.Web/Components/Pages/Game.razor
PageAsync sorts mapped endpoints using the declared hostname. Game.razor preserves the supplied order within current and former endpoint groups, while placing current endpoints first.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PageAsync as NpgsqlGameQueries.PageAsync
  participant Sort as EndpointOrder.Sort
  participant GamePage as Game.razor
  PageAsync->>Sort: mapped endpoints and declared hostname
  Sort-->>PageAsync: sorted endpoints
  PageAsync->>GamePage: Page.Endpoints
  GamePage->>GamePage: render current endpoints before former endpoints
Loading
Merge Risk: Minimal · up to 7f106

This changes only the order in which a game's endpoints are listed, so the declared hostname comes first and IP addresses come last. No endpoints are hidden or removed, so the merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: game endpoints are now listed with the declared hostname first, then other names, then IP literals. The raw summary confirms EndpointOrder.Sort, the GamePage change, a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: game endpoints are now listed with the declared hostname first, then other names, then IP literals. The raw summary confirms EndpointOrder.Sort, the GamePage change, and the EndpointOrderTests suite all implement this ordering. The title is specific and does not describe anything absent from the changeset.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 58cc3f84-ccc5-4672-b21e-d2e01f2af802
Commits

Reviewing files that changed from the base of the PR and between 4131958 and 7f106aa.

Files selected for processing: 4

  • src/MUI.Catalog/Games/EndpointOrder.cs
  • src/MUI.Catalog/Persistence/Queries/NpgsqlGameQueries.GamePage.cs
  • src/MUI.Web/Components/Pages/Game.razor
  • tests/MUI.Catalog.Tests/Games/EndpointOrderTests.cs

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@HarryCordewener
HarryCordewener marked this pull request as ready for review December 2, 2026 09:58
@HarryCordewener
HarryCordewener merged commit 1da3dac into main Dec 2, 2026
3 checks passed
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.

2 participants