Detecting duplicate activities
How does one go about detecting duplicate activities, and what is the best practice for senders?
I ask because following a hashtag served by relay.fedi.buzz responds with an Accept with id https://relay.fedi.buzz/activity/accept/%7Bactor%7D/%7BrequesterInbox%7D
Because that URL does not have a random/time-based component, an unfollow followed by a refollow will lead to an Accept with the exact same id.
In NodeBB's case, it detects this as "already seen" and silently drops it.
I could ask @[email protected] to add a timestamp in the ID, but I was wondering if my duplicate detection strategy was naive :smile:
5 replies
PieFed activities each have a unique ID, with a guid in it.
@julian @astro There are two related unwritten rules of fediverse:
Because of (1), the
idof activity should be different if the body is different.But because of (2), it should be ok to process the same activity multiple times.
@[email protected] okay, but in the case of the accept, the body is identical, but is only different because of where it sits relative to other activities (e.g. it came after an unfollow therefore it is relevant again)
It makes me think back to why I added dupe detection in the first place. Likely it was to handle Delete spam, but I can't remember anymore.
cc @[email protected]
@julian @astro Is the body really identical? I would expect
Accept.objectto be different if it is a re-follow@[email protected] good point! The embedded object likely is unique.