On lemmy-ui if both posts are both “visible” in the feed they will be compacted into one post if they share the same link meaning there wont be a duplicate post (unless you paginate and theyre on different pages)
Some other frontends such as sync dont do this though but they really should