Interface ISupportEventLedger
Remembers which inbound channel events have already been handled, so a redelivery is not applied twice.
public interface ISupportEventLedger
Remarks
Slack retries are guaranteed, not exceptional. Any non-200, any timeout, any response slower than three seconds, and the same event arrives again carrying the same id. Without a ledger a retry appends the same reply to the case a second time, which is the failure a user actually notices.
It must be shared across instances, for the same reason ITeamCache exists: with a process-local set, two instances behind a load balancer each accept the same retry and the deduplication achieves nothing. ITeamCache itself is deliberately not reused — it is purpose-built for three named claims lookups and has no general key/value surface, so putting an event id through it would be an abuse of a security-sensitive cache rather than a fit.
Record-and-report, not check-then-act. The single method exists so an implementation can make the decision atomic — a unique index, an insert that fails on conflict. A separate "have I seen this?" followed by "remember it" is a race that two instances lose at exactly the moment retries arrive together, which is precisely when it matters.
Methods
TryRecordAsync(string, string, CancellationToken)
Records an event as handled, returning true when it was new and false when it had
already been recorded.
Task<bool> TryRecordAsync(string source, string eventId, CancellationToken cancellationToken = default)
Parameters
sourcestringWhich channel the event came from, so two channels cannot collide on an id.
eventIdstringThe channel's own identifier for the delivery.
cancellationTokenCancellationTokenAbandons the attempt.