To solve that issue you need a cooperating destination for your writes which handles de-duplication. Then you get into the weeds of causality, ordering and idempotence. Ugh.
For some real world examples see the AWS Kinesis documentation which says that any application using Kinesis must be able to handle duplicate records [1].
> There are two primary reasons why records may be delivered more than one time to your Amazon Kinesis Data Streams application: producer retries and consumer retries. Your application must anticipate and appropriately handle processing individual records multiple times.
[0]: https://en.wikipedia.org/wiki/Two_Generals%27_Problem
[1]: https://docs.aws.amazon.com/streams/latest/dev/kinesis-recor...