Why dedupe isn't a rule in the chain
transcript
The order system sends the shipping event twice. Ana should get one email. Not two. So you add a duplicate check. But where?
The service has a chain of rules. Opt out, then quiet hours. It runs before every attempt. Retries pass through it again.
Put dedupe in the chain, and the first attempt records the key. The first send fails and retries. The retry runs the chain again. It finds its own key and is dropped as a duplicate. Nothing is ever sent.
Check dedupe once, when the request is admitted. Key it by user, channel and event, for an hour. After admission, a retry is the same delivery, not a new one.
A real duplicate is not ignored silently. It becomes a delivery, marked dropped, with the reason duplicate. The audit trail shows the event was seen twice.
Dedupe once, at admission. Never on a retry.
The full design is in the lecture. Channels, rules, retries and dedupe.