Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 2:45 PM ET / 18:45 UTC. ClawSweeper reviewWhat this changesThe PR makes Buzz validate relay NIP-11 metadata through the shared bounded JSON-object reader and updates relay-fetch tests to use real Response bodies. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open. Current main still fully buffers Buzz relay metadata; the patch uses the existing canonical bounded reader and has no correctness finding, but maintainers should explicitly accept the new 16 MiB compatibility boundary and refresh the behind branch before merge. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherBuzz Gateway startup authenticates with a relay and fetches its NIP-11 metadata before verifying relay identity and discovering rooms. This parsing step feeds all authenticated Buzz session consumers, including normal bus startup and room discovery. flowchart LR
A[Gateway starts Buzz account] --> B[Authenticate with relay]
B --> C[Fetch NIP-11 metadata]
C --> D[Bounded JSON-object reader]
D --> E[Validate relay identity]
E --> F[Discover rooms and deliver messages]
Decision needed
Why: The parser choice is architecturally sound, but changing acceptance for already configured relays is an operator-facing compatibility policy decision. Before merge
Agent review detailsSecurityNone. PR surfaceSource -2, Tests +62. Total +60 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Adopt the shared bounded-reader path as the sole parser after explicitly accepting 16 MiB as Buzz’s supported relay-metadata ceiling. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s direct response.json() call provides a clear source path, and the PR supplies focused boundary tests plus an after-fix loopback Gateway/relay trace. Is this the best way to solve the issue? Yes, conditionally. Reusing the shared reader at the authenticated relay-session owner avoids Buzz-specific duplicate parsing; only the 16 MiB compatibility policy needs maintainer acceptance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5976e74d1cc8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
6953d22 to
6d8b231
Compare
Reject malformed relay metadata and cancel oversized response streams at the existing 16 MiB provider boundary. Co-authored-by: zhang-guiping <[email protected]>
6d8b231 to
8ae37b0
Compare
|
Merged via squash.
|
Reject malformed relay metadata and cancel oversized response streams at the existing 16 MiB provider boundary. Co-authored-by: Peter Steinberger <[email protected]>
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where enabling Buzz against a relay with an oversized NIP-11 information response could make the Gateway buffer the response without a limit. Malformed or non-object relay information could also surface a raw JavaScript error instead of a stable Buzz diagnostic.
Why This Change Was Made
Buzz relay discovery now uses the existing shared provider JSON object reader, which bounds response reads at 16 MiB and normalizes malformed or non-object documents. This keeps the limit, shape validation, and cancellation behavior aligned with the canonical HTTP response helper rather than adding a Buzz-specific parser or policy.
User Impact
Gateways stop reading oversized Buzz relay-information responses, remain running, and report clear bounded-response or malformed-JSON errors. JSON primitives and arrays are rejected as malformed NIP-11 documents, while valid objects continue through the existing relay-key validation path.
Evidence
Focused regression tests (6 files, 27 tests):
Real Gateway proof using the development Gateway starter and a loopback HTTP/WebSocket relay that performs NIP-42 authentication before serving NIP-11 information: