Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Technical Discussion
  3. Detecting duplicate activities

Detecting duplicate activities

Scheduled Pinned Locked Moved Technical Discussion
activitypubfedibuzz
6 Posts 3 Posters 2 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • julianJ This user is from outside of this forum
    julianJ This user is from outside of this forum
    julian
    wrote on last edited by
    #1

    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/{actor}/{requesterInbox}

    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 @astro@c3d2.social to add a timestamp in the ID, but I was wondering if my duplicate detection strategy was naive <img class="not-responsive emoji" src="https://activitypub.space/assets/plugins/nodebb-plugin-emoji/emoji/android/1f604.png?v=4459463b5a0" title="😄" />

    1 Reply Last reply
    1
    0
    • R AodeRelay shared this topic on
    • silverpillS This user is from outside of this forum
      silverpillS This user is from outside of this forum
      silverpill
      wrote on last edited by
      #2

      @julian @astro There are two related unwritten rules of fediverse:

      1. Activities should be immutable
      2. Activities should be idempotent

      Because of (1), the id of activity should be different if the body is different.

      But because of (2), it should be ok to process the same activity multiple times.

      julianJ 1 Reply Last reply
      0
      • silverpillS silverpill

        @julian @astro There are two related unwritten rules of fediverse:

        1. Activities should be immutable
        2. Activities should be idempotent

        Because of (1), the id of activity should be different if the body is different.

        But because of (2), it should be ok to process the same activity multiple times.

        julianJ This user is from outside of this forum
        julianJ This user is from outside of this forum
        julian
        wrote on last edited by
        #3

        @silverpill@mitra.social 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 @astro@c3d2.social

        1 Reply Last reply
        1
        0
        • silverpillS This user is from outside of this forum
          silverpillS This user is from outside of this forum
          silverpill
          wrote on last edited by
          #4

          @julian @astro Is the body really identical? I would expect Accept.object to be different if it is a re-follow

          julianJ 1 Reply Last reply
          0
          • RimuR This user is from outside of this forum
            RimuR This user is from outside of this forum
            Rimu
            wrote on last edited by
            #5

            PieFed activities each have a unique ID, with a guid in it.

            1 Reply Last reply
            1
            0
            • silverpillS silverpill

              @julian @astro Is the body really identical? I would expect Accept.object to be different if it is a re-follow

              julianJ This user is from outside of this forum
              julianJ This user is from outside of this forum
              julian
              wrote on last edited by
              #6

              @silverpill@mitra.social good point! The embedded object likely is unique.

              1 Reply Last reply
              1
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              Powered by NodeBB Contributors
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups