mirror of
https://github.com/block/buzz.git
synced 2026-11-01 23:11:58 +00:00
Two bugs surfaced by the full nextest run after the origin/main merge:
F1 — description wrapper-overhead off-by-two:
wrapper_overhead was 3 ('(' + possible '…' + ')'), but the UTF-8
ellipsis U+2026 is 3 bytes on its own, so the truncated form
'(ctx…)' costs 1 + 3 + 1 = 5 bytes of overhead. Changing the
constant from 3 → 5 keeps the combined description within
DESCRIPTION_COMBINED_MAX_BYTES in both the truncated and
non-truncated paths.
F3 — allow_always_and_reject_always_decisions_are_ignored_by_read_loop:
read_until_response_with_idle_timeout takes the permission decision
receiver via .take() and drops it on return. The original test
called the loop three times with 200ms timeouts, causing the
receiver to be dropped after the first call; subsequent perm_tx
sends panicked with SendError. Restructured to pre-send all three
decisions (allow_always, reject_always, allow_once) into the channel
buffer before the loop runs once — the loop processes them in order,
ignores the two non-ruled options, and resolves on allow_once,
matching the pattern established in early_decision_first_wins.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>