fix(discord): reuse nonces after lost responses

A successful create may lose its response. Reuse a stable nonce
with enforce_nonce so retries recover that message instead of
posting duplicates or accepting an unreadable success.
This commit is contained in:
翅膀 committed 2026-10-23 23:22:29 +08:00
1 parent 966403bdc1
commit 7cf507f654
3 files changed
+28 -11

No files matched your search

+7
View File
@@ -326,6 +326,13 @@ export interface NeutralMessage {
* only to find a message tracked under the old key (then re-keyed).
*/
legacyUpdateKey?: string;
/**
* Stable identity of this message for one target, the same in every
* attempt of a delivery (set by dispatch from delivery × route × target).
* Platforms with request idempotency (Discord `nonce`, Feishu `uuid`) use
* it, so a retry after a lost response never posts the message twice.
*/
sendKey?: string;
/**
* Discord role ids to mention in the message content (set by dispatch from
* the route's `discordRoleIds`). Only used by the Discord driver.