mirror of
https://github.com/block/buzz.git
synced 2026-11-26 11:12:22 +00:00
Review follow-up for the first-send-after-community-switch fix. Desktop: move the OK-frame settle/retry logic from relayClientSession.ts (already over the file-size ratchet; grew 1084 -> 1129) into a pure `handlePublishOk` in relayPublishRecovery.ts, taking the pending map and a send callback. The session file now shrinks to 1078. Drop the uncorrelated NOTICE retry-all. A `NOTICE rate-limited:` may have been triggered by a REQ or COUNT, and an ephemeral event (e.g. presence, kind 20001) the relay already fanned out has no id dedup, so resending every in-flight publish could double-deliver. Only the correlated `OK false rate-limited:` is retried; the NOTICE still arms the gate. The test now asserts NOTICE never resends, and the reset test stubs the Tauri websocket disconnect so it runs without a stderr TypeError. Mobile: relay_session.dart tripped the same ratchet (1000 -> 1005). The classify-then-arm sequence appeared three times, so it becomes `RelayRateLimitGate.activateIfRateLimited(message)`; the session file drops to 995. Gate unit test added. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>