What happened (2026-11-23): Postgres lost the bridge's pg_hba rule (pve-infra#17 fixes the cause). The bridge kept running without database access. At 10:28 a relayed message went to Discord as @jared:matrix.lotusguild.org with no avatar, instead of the sender's display name and picture. The bridge then crashed when it tried to save the message record.
Why:getRelayUserMeta read the sender's display name and avatar only from the bridge's DB copy of room membership (StateStore.GetMember). When that read failed, it fell back to the raw Matrix ID with no avatar.
Fix: patch 0003 reads members through IntentAPI.Member. That uses the same cache, but asks Synapse for the member event when the cached read fails or misses. The reply-embed name uses it too. In normal operation nothing changes: the cache hits and no extra request is made.
Testing:
go vet is clean.
Built with build-patched.sh; patches 0001–0003 apply cleanly to v0.7.7, and the existing Retry/Echo tests pass.
Deployed to LXC 151 at 11:32. The bridge started and connected to Discord.
Backup of the previous binary: /opt/mautrix-discord/mautrix-discord.bak-20261123-patch0002.
**What happened (2026-11-23):** Postgres lost the bridge's pg_hba rule (pve-infra#17 fixes the cause). The bridge kept running without database access. At 10:28 a relayed message went to Discord as `@jared:matrix.lotusguild.org` with no avatar, instead of the sender's display name and picture. The bridge then crashed when it tried to save the message record.
**Why:** `getRelayUserMeta` read the sender's display name and avatar only from the bridge's DB copy of room membership (`StateStore.GetMember`). When that read failed, it fell back to the raw Matrix ID with no avatar.
**Fix:** patch `0003` reads members through `IntentAPI.Member`. That uses the same cache, but asks Synapse for the member event when the cached read fails or misses. The reply-embed name uses it too. In normal operation nothing changes: the cache hits and no extra request is made.
**Testing:**
- `go vet` is clean.
- Built with `build-patched.sh`; patches 0001–0003 apply cleanly to v0.7.7, and the existing Retry/Echo tests pass.
- Deployed to LXC 151 at 11:32. The bridge started and connected to Discord.
- Backup of the previous binary: `/opt/mautrix-discord/mautrix-discord.bak-20261123-patch0002`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
On 2026-11-23 the bridge lost database access (pg_hba rule wiped by a
pve-infra deploy) but kept running. A relayed message then went to Discord
as "@jared:matrix.lotusguild.org" with no avatar, because the sender's
display name/avatar come only from the bridge's DB copy of room state and
that read failed.
Patch 0003 reads members through IntentAPI.Member, which uses the same
cache but asks Synapse when the cached read fails or misses. Also used for
the name in reply embeds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
jared
scheduled this pull request to auto merge when all checks succeed 2026-11-23 11:36:57 -05:00
jared
merged commit c7ef863530 into main2026-11-23 11:39:00 -05:00
jared
deleted branch discord-bridge/relay-name-fallback2026-11-23 11:39:19 -05:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What happened (2026-11-23): Postgres lost the bridge's pg_hba rule (pve-infra#17 fixes the cause). The bridge kept running without database access. At 10:28 a relayed message went to Discord as
@jared:matrix.lotusguild.orgwith no avatar, instead of the sender's display name and picture. The bridge then crashed when it tried to save the message record.Why:
getRelayUserMetaread the sender's display name and avatar only from the bridge's DB copy of room membership (StateStore.GetMember). When that read failed, it fell back to the raw Matrix ID with no avatar.Fix: patch
0003reads members throughIntentAPI.Member. That uses the same cache, but asks Synapse for the member event when the cached read fails or misses. The reply-embed name uses it too. In normal operation nothing changes: the cache hits and no extra request is made.Testing:
go vetis clean.build-patched.sh; patches 0001–0003 apply cleanly to v0.7.7, and the existing Retry/Echo tests pass./opt/mautrix-discord/mautrix-discord.bak-20261123-patch0002.🤖 Generated with Claude Code
https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA