Fix governance feed and IPv6 masternode search#27
Conversation
Skip malformed governance objects instead of failing the public feed, and preserve IPv6 host searches so exact lookups do not over-match unrelated nodes. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 642453a4ef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const search = (req.body.search || "").replace(/ /g, ""); | ||
|
|
||
| const query = search.includes(":") ? search.split(":")[0] : search; | ||
| const query = endpointHost(search); |
There was a problem hiding this comment.
Strip unbracketed IPv6 port from search query
When a user searches with an unbracketed IPv6 endpoint that includes a port (for example, copy/pasting 2001:db8::1:18370 from the address column), query keeps the port while each masternode address is normalized with stripUnbracketedIpv6Port: true, so the exact IPv6 comparison can never match. This makes valid IPv6 entries unsearchable in that common input path; normalize the query with the same port-stripping rule (or compare endpoint-to-endpoint consistently) before the addressHost === query check.
Useful? React with 👍 / 👎.
Accept copied unbracketed IPv6 endpoints with ports while keeping exact host matching for IPv6 searches. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
DataStringentries so one bad object does not fail/govlist./mnsearchso exact IPv6 searches do not collapse to the first hextet.Fixes #25.
Fixes #26.
Test plan
npm test -- --runInBand tests/governance.routes.test.js tests/mnSearch.routes.test.jsnpm test -- --runInBandMade with Cursor