Notes
Gateways retry. Here is how to make duplicates harmless by design.
Why explicit states beat boolean flags every single time.