haykam821 / ShortcutsPreview

A multiplatform bot for showing the details of Shortcuts when linked by their iCloud URL.
MIT License
33 stars 5 forks source link

Prevent duplicate previews on Reddit #3

Open haykam821 opened 5 years ago

haykam821 commented 5 years ago

Sometimes, the current library for an event per submission to a subreddit in this project is Snoostorm. However, sometimes it ends up in duplicate posts. We should switch to Snoostream to prevent handling the same post twice and ending up in duplicate previews.

That has been tried, and ended up in a crash every time there was a new post, leading to it being reverted in c107add00367961c45e1034bd59989d509986f95. We need to figure out another way.

haykam821 commented 5 years ago

Reopened because the closing change has been reverted (c107add00367961c45e1034bd59989d509986f95) because Snoostream crashes all the time. We'll need to find another way to prevent duplicates.

Hacksore commented 5 years ago

Would it not be best to link a DB on the bot side to keep track of where it's posted a reply? That would seem like the best way to prevent duplicates in my opinion.

haykam821 commented 5 years ago

I'm against a database in ShortcutsPreview itself, but if it's needed we can make a Snoostream/Snoostorm alternative.

haykam821 commented 5 years ago

@Hacksore Would you be interested in doing the above? As a temporary fix, we can check for a stickied comment by the authenticated account, but that'd mean sticky privileges would be required.

Hacksore commented 5 years ago

@haykam821 Are there method(s) in the reddit API wrapper to check for that?

haykam821 commented 5 years ago

@Hacksore Probably, but a far simpler solution that I have been made aware of is to save the post and ignore it if it has been saved.

Hacksore commented 1 year ago

@haykam821 can we please close this?