Trouble with `discourse remap` remapping `topic_links url`

I’ll give that a shot. My solution was to add a next if parsed.length > 500 to self.extract_from(post) intopic_link.rb`. It seems like that would fix it for everyone. I think that it worked on the site where I am doing the remapping, but then I’m getting

Error: ERROR:  duplicate key value violates unique constraint "unique_post_links"
DETAIL:  Key (topic_id, post_id, url)=(19484, 61049, https://staging.community.rstudio.com/t/birds-of-a-feather-bof-at-rstudio-conf-2019l/19328) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.

More on this over at Migrate_to_s3 for Digital Ocean Spaces woes. I hit the same topic_link problem doing the S3 migrate on another site.