fix(discord): tolerate reply dedupe storage failures (#218, #258)

This commit is contained in:
Saqeb Akhter committed 2026-11-17 23:25:43 +04:00
1 parent e99b42c387
commit ba4a1c16e2
5 files changed
+199 -2

No files matched your search

+14
View File
@@ -135,3 +135,17 @@ The text explains `codeman notify "message" --urgent`. `codeman` is on the PATH
| Posts arrive but replies do nothing | Message Content Intent is off, or your user ID is not in the allowlist |
| Thread is not deleted | The bot lacks Manage Threads on the parent channel |
| Nothing arrives on the phone | Check the Discord app's notification setting for the server |
## Reply replay protection
The bridge remembers up to 2,048 recent Discord reply IDs for seven days in the private
`discord-reply-dedupe.json` metadata file. It claims an allowed reply before downloading
attachments or typing into its session, so a gateway replay normally cannot type it twice,
including after a restart. The file contains IDs and timestamps only, with mode 0600.
This is best-effort replay protection, not an exactly-once guarantee. A full disk, unreadable
file, or invalid metadata logs one content-free warning and falls back to in-memory checks.
Reads and writes retry on later replies; a restart during a metadata outage can lose those
checks. At capacity the oldest entries are evicted, so capacity never blocks new replies.
Notifications retain their existing delivery and retry behavior; this store never suppresses
an outbound alert or replays terminal input.