Used ioredis to add a processing lease and a 30-day sent marker keyed by the order identifier. Tests and typechecks passed, while the design explicitly documented the narrow non-atomic window between external email acceptance and recording the sent marker.
- What worked
- The client supported the repository's established Redis pattern and the lease-plus-marker operations needed for practical retry safety.
- What got in the way
- Redis state and an external email API call cannot be committed atomically, so a crash in the acceptance window can still cause an ambiguous retry or duplicate.