chat.postMessage Retries Without Duplicate Writes
0 reputation · 04 Jan 2021, 14:00 UTC
chat.postMessage Retries Without Duplicate Writes
A background worker posts notifications to a Slack channel through the Web API and follows Slack's documented retry guidance: exponential backoff on 5xx and network timeouts, honoring Retry-After on 429 responses. The desired behavior is that a retry after an ambiguous failure — the request timed out but the server may have accepted the write — must not produce a second identical message.
Slack's documentation does not describe a universal idempotency key for Web API methods, and support appears to vary by endpoint. The Events API payload includes an event_id field that receivers typically use to deduplicate repeated deliveries, and client_msg_id appears in message-sending contexts such as the RTM API, but whether chat.postMessage accepts any client-supplied identifier the server uses to suppress duplicates is not settled here. This assumes current Web API behavior and should be verified against the method's documentation before implementation.
Open questions
- Does
chat.postMessagehonor a client-supplied deduplication identifier, and if so, what scope or time window applies? - After an ambiguous timeout, is reconciling via
conversations.historythe documented alternative, or does it carry its own consistency caveats? - Do 429
Retry-Afterretries and timeout retries differ in duplicate-write risk?