As per the explanation provided here: https://github.com/decred/atomicswap
The contract is valid for a certain amount of time (example set to 48h) and in order for the party B to recover the found, he needs the secret that is published on the chain after the party A has redeem the coins on the contract.
As far as I understand, it takes some time for party B to actually recover the secret from the chain and then redeem the coins.
What happens if party A wait last seconds (let's say 5 seconds) before expiration of the contract to redeem the coin, which wouldn't provide enough time for party B to redeem its coin before the contract expiration in which case it would be refunded to party A as well as getting party B coins.
Is the understanding correct and that point valid?
Is it fixable by setting different contract expiration period, lets say party A contract would need longer expiration time to ensure party B ha time to redeem the coins?