The simple solution is to know what coins (UTXO) one owns and recognize if they are spend no matter with what hash.
I can't comprehend why anyone would code a wallet that doesn't do this. There's no excuse for failing to notice relevant changes to the canonical source of your balance information, the blockchain.