At-least-once delivery + idempotency

The Activity POSTs, then errors. Temporal retries. The receiver sees every POST. Without an idempotency key, every retry also lands.
Without Idempotency-Key
Attempt 1
·
Receiver
·
Attempt 2
·
Receiver
·
Attempt 3
·
Receiver
·
received
0
processed
0
deduped
0
With Idempotency-Key
Attempt 1
·
Receiver
·
Attempt 2
·
Receiver
·
Attempt 3
·
Receiver
·
received
0
processed
0
deduped
0
The fix: one line in activities.ts
Without (bug)
const headers: Record<string, string> = {
  'Content-Type': 'application/json',
  // no Idempotency-Key
};
With (fix)
const headers: Record<string, string> = {
  'Content-Type': 'application/json',
  'Idempotency-Key': `webhook:${req.eventId}`,
};