Ok I’m not good with this so I can explain how it happened. But what I saw on Blue wallet is: I sent the sats to my address but, before any confirmation, there is a Cancel Transaction button that other user with the same seed phrase can click to cancel my transaction and send the sats to his wallet.
Discussion
i don’t know Blue walllet, but my guess is that this Cancel button does exactly that: generates a replacement transaction with higher fee..
in other words, i don’t think there’s something you can do to avoid this situation.. maybe you could track your and other double spending transactions in the mempool and generate a new one every time you see another with higher fee, until it is included in a block