dashboard: list record types in the README's order (closes #226) #243

Merged
clawbot merged 1 commits from issue-226-record-type-order into next 2026-10-02 09:55:07 +02:00
Collaborator

Closes #226

Each row of the dashboard's Hostnames table listed a nameserver's record types in whatever order Go walked the record map, which changed from row to row and on every load. formatRecords in internal/handlers/dashboard.go now sorts the types by their place in the README's list (A, AAAA, CNAME, MX, TXT, SRV, CAA, NS); a type not in that list comes after them, in alphabetical order. A new test builds records for all eight types and two others and checks the exact output.

Not visible in the diff:

  • Values within one type were already sorted by the resolver, so the order of types was the only thing that made rows of agreeing nameservers differ.
  • The list is a literal inside formatRecords. The resolver's list of types it asks for (recordTypes in internal/resolver/iterative.go) holds the same types in the same order, but it is unexported and in DNS type numbers, so it is not reused.
  • /api/v1/status is unchanged; its JSON already lists record types sorted by name.

Disclosures:

  • Judgement call: types outside the README's list go in alphabetical order; the issue says only that they come after.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/dnswatcher/issues/226 Each row of the dashboard's Hostnames table listed a nameserver's record types in whatever order Go walked the record map, which changed from row to row and on every load. `formatRecords` in `internal/handlers/dashboard.go` now sorts the types by their place in the README's list (A, AAAA, CNAME, MX, TXT, SRV, CAA, NS); a type not in that list comes after them, in alphabetical order. A new test builds records for all eight types and two others and checks the exact output. Not visible in the diff: - Values within one type were already sorted by the resolver, so the order of types was the only thing that made rows of agreeing nameservers differ. - The list is a literal inside `formatRecords`. The resolver's list of types it asks for (`recordTypes` in `internal/resolver/iterative.go`) holds the same types in the same order, but it is unexported and in DNS type numbers, so it is not reused. - `/api/v1/status` is unchanged; its JSON already lists record types sorted by name. Disclosures: - Judgement call: types outside the README's list go in alphabetical order; the issue says only that they come after. Model: opus-5-5
clawbot added the needs-review label 2026-10-02 09:23:10 +02:00
clawbot self-assigned this 2026-10-02 09:23:10 +02:00
clawbot added 1 commit 2026-10-02 09:23:10 +02:00
Each row of the Hostnames table listed a nameserver's record types in
the order Go happens to walk the record map, which changed from row to
row and on every page load, so two nameservers with the same records
looked different. formatRecords now sorts the types by their place in
the README's list (A, AAAA, CNAME, MX, TXT, SRV, CAA, NS); any other
type comes after them in alphabetical order. Values within a type were
already sorted by the resolver.

Model: opus-5-5
Author
Collaborator

Review passed on f4d71f2.

Model: opus-5-5

Review passed on f4d71f2. Model: opus-5-5
clawbot merged commit 1218df9467 into next 2026-10-02 09:55:07 +02:00
clawbot deleted branch issue-226-record-type-order 2026-10-02 09:55:07 +02:00
clawbot removed the needs-review label 2026-10-02 09:55:07 +02:00
Sign in to join this conversation.