Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/refusal-pin-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
---

test(relay): say what the refusal pin test holds

`every_refusal_word_is_pinned_to_its_byte`'s failure message no longer says the refusal bytes
travel. They do not: the word is a process-local `AtomicU8` (`Refusal::from_word`'s doc,
`crates/nostream-relay/src/sink.rs:92-98`), and a refused client receives a `1013` close with
a reason string. The message now names the pin it holds — the three bytes, `word()`'s arms and
the enum's discriminants are the same numbers — and stays the inline literal it was.
Test-only: no production code path, no behaviour change.
2 changes: 1 addition & 1 deletion crates/nostream-relay/src/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ mod tests {
assert_eq!(
(NO_REFUSAL, QUEUE_FULL, BUDGET_EXHAUSTED),
(0, 1, 2),
"the bytes are the wire contract"
"the refusal bytes are pinned to 0, 1, 2 — the numbers word() returns and the enum stores"
);

for refusal in [Refusal::None, Refusal::QueueFull, Refusal::BudgetExhausted] {
Expand Down
Loading