On 2026-11-15 21:34 an image relay failed with "read: connection reset by
peer" after the request was sent. Patch 0001 deliberately doesn't retry
those (a webhook post has no dedupe), so the image was dropped.
Patch 0002: while a relay send is in flight the bridge watches the
Discord gateway for its own post (same webhook, text and attachment
count, created after the send started). On an ambiguous failure (reset,
EOF, timeout waiting for the reply, Discord 5xx) it waits up to 6 s for
that echo: if it shows up the send counts as delivered and is recorded
(no resend, no copy back into Matrix); otherwise it retries with the
0001 backoff, checking again before each resend.
build-patched.sh runs the new tests with -race.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA