mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 08:27:04 +00:00
The test asserted exactly two EOSEs (`assertEquals(2, eoseCount)`) and looped `while (eoseCount < 2)`. But a re-REQ on the same subscription id silently replaces the previous subscription (NIP-01), and RelaySession.handleReq cancels the in-flight query coroutine without emitting an EOSE for the superseded filter. So when both mid-stream re-subscriptions get collapsed before reaching EOSE, only the final, never-superseded filter emits one — the consumer loop then blocks on receive() until the 30s timeout and the assertion fails. Drain until the relay goes quiet (idle-gap timeout) instead of counting on a fixed number of EOSEs, and assert only invariants that hold for every interleaving: at least one EOSE arrives, every non-EOSE entry is a valid 64-char id, the final advertised-relay-list filter actually streamed its events, and the total stays under a sane upper bound. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018e1bfPf4HZDCvwcfiEHECk