discord-bridge: check the gateway echo before retrying ambiguous webhook sends
Lint / Shell (shellcheck) (push) Successful in 29s
Lint / JS (eslint) (push) Successful in 27s
Lint / No Hookshot webhook IDs in README (push) Successful in 12s
Lint / No secrets in webhook configs (push) Successful in 8s
Lint / Landing page is rendered (matrix (push) Successful in 5s
Lint / Python (ruff) (push) Successful in 6s
Lint / Secret scan (gitleaks) (push) Successful in 7s
Lint / Shell (shellcheck) (pull_request) Successful in 7s
Lint / JS (eslint) (pull_request) Successful in 17s
Lint / No Hookshot webhook IDs in README (pull_request) Successful in 9s
Lint / No secrets in webhook configs (pull_request) Successful in 19s
Lint / Python deps (pip-audit) (push) Successful in 1m18s
Lint / Landing page is rendered (matrix (pull_request) Successful in 11s
Lint / Python (ruff) (pull_request) Successful in 22s
Lint / Secret scan (gitleaks) (pull_request) Successful in 7s
Lint / Python deps (pip-audit) (pull_request) Successful in 34s
Lint / Shell (shellcheck) (push) Successful in 29s
Lint / JS (eslint) (push) Successful in 27s
Lint / No Hookshot webhook IDs in README (push) Successful in 12s
Lint / No secrets in webhook configs (push) Successful in 8s
Lint / Landing page is rendered (matrix (push) Successful in 5s
Lint / Python (ruff) (push) Successful in 6s
Lint / Secret scan (gitleaks) (push) Successful in 7s
Lint / Shell (shellcheck) (pull_request) Successful in 7s
Lint / JS (eslint) (pull_request) Successful in 17s
Lint / No Hookshot webhook IDs in README (pull_request) Successful in 9s
Lint / No secrets in webhook configs (pull_request) Successful in 19s
Lint / Python deps (pip-audit) (push) Successful in 1m18s
Lint / Landing page is rendered (matrix (pull_request) Successful in 11s
Lint / Python (ruff) (pull_request) Successful in 22s
Lint / Secret scan (gitleaks) (pull_request) Successful in 7s
Lint / Python deps (pip-audit) (pull_request) Successful in 34s
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
This commit is contained in:
@@ -418,9 +418,13 @@ channel webhook with their own display name.
|
||||
- `0001`: when a Matrix → Discord send fails before the request reaches Discord (DNS, connect, or
|
||||
`TLS handshake timeout`), the bridge retries after 2, 5, 10, 20, 30, 60, 60 and 60 s instead of
|
||||
dropping the message with "⚠ Your message may not have been bridged". The room's later messages wait
|
||||
in order behind the retry. Failures after the request was sent are not retried, because a webhook
|
||||
send has no dedupe and a retry could post the message twice. Edits, reactions and deletes are not
|
||||
retried.
|
||||
in order behind the retry. Edits, reactions and deletes are not retried.
|
||||
- `0002`: when a relay (webhook) send fails after the request may already have reached Discord
|
||||
(connection reset, EOF, timeout waiting for the reply, Discord 5xx), the bridge waits up to 6 s for
|
||||
its own post to come back over the Discord gateway. If it does, the send counts as delivered (no
|
||||
resend, no copy back into Matrix); if not, it retries with the 0001 backoff, checking again before
|
||||
each resend. A webhook post has no dedupe, so this echo check is what keeps those retries from
|
||||
double-posting.
|
||||
|
||||
**Install (one time):** after this repo's `main` has reached `/opt/matrix-config` on LXC 151, run this
|
||||
on the Proxmox node hosting LXC 109 and 151. It restarts Synapse once and is safe to re-run.
|
||||
|
||||
Reference in New Issue
Block a user