discord-bridge: retry Matrix→Discord sends that failed before reaching Discord
Lint / Shell (shellcheck) (push) Successful in 45s
Lint / JS (eslint) (push) Successful in 41s
Lint / No Hookshot webhook IDs in README (push) Successful in 6s
Lint / No secrets in webhook configs (push) Successful in 8s
Lint / Landing page is rendered (matrix (push) Successful in 8s
Lint / Python (ruff) (push) Successful in 6s
Lint / Secret scan (gitleaks) (push) Successful in 12s
Lint / Python deps (pip-audit) (push) Successful in 38s
Lint / Shell (shellcheck) (pull_request) Successful in 10s
Lint / JS (eslint) (pull_request) Successful in 8s
Lint / No Hookshot webhook IDs in README (pull_request) Successful in 10s
Lint / No secrets in webhook configs (pull_request) Successful in 6s
Lint / Landing page is rendered (matrix (pull_request) Successful in 7s
Lint / Python (ruff) (pull_request) Successful in 8s
Lint / Secret scan (gitleaks) (pull_request) Successful in 11s
Lint / Python deps (pip-audit) (pull_request) Successful in 31s

Upstream mautrix-discord v0.7.7 sends each message once; a momentary
"net/http: TLS handshake timeout" dropped a message on 2026-11-14 with
only a "may not have been bridged" notice. Patch 0001 retries pre-send
network failures (DNS, dial, TLS handshake) with backoff (~4 min budget),
inline in the per-room loop so order is kept. Post-send failures are not
retried to avoid duplicate webhook posts.

Adds the patch, build-patched.sh (clone tag, apply, test, cgo build
against libolm) and README notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
2026-11-14 14:28:05 -05:00
co-authored by Claude Opus 5.5
parent 16eca51e4c
commit 037b6291c9
3 changed files with 301 additions and 0 deletions
+9
View File
@@ -412,6 +412,15 @@ channel webhook with their own display name.
- Database: `mautrix_discord` on LXC 109, role `mautrix_discord`, allowed from 10.10.10.29 in `pg_hba.conf`
- Service: `systemctl status mautrix-discord`, logs in `journalctl -u mautrix-discord` and `/var/log/mautrix-discord/`
- End-to-bridge encryption is allowed, so it can join encrypted rooms
- **Patched build.** The deployed binary is upstream v0.7.7 plus `discord-bridge/patches/`, built with
`discord-bridge/build-patched.sh` (deploy steps are in the script's header). `install.sh` still
downloads the stock release, so rebuild and redeploy the patched binary after any (re)install or upgrade.
- `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.
**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.