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 (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. General Discussion
  3. I've been reviewing the new FEP from the Mastodon team today, and one thing that caught my attention is the use of Accept and Reject activities for managing approvals.

I've been reviewing the new FEP from the Mastodon team today, and one thing that caught my attention is the use of Accept and Reject activities for managing approvals.

Scheduled Pinned Locked Moved General Discussion
activitypub
1 Cross-posts 21 Posts 6 Posters 0 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.
  • silverpill@mitra.socialS This user is from outside of this forum
    silverpill@mitra.socialS This user is from outside of this forum
    silverpill@mitra.social
    wrote last edited by
    #1

    I've been reviewing the new FEP from the Mastodon team today, and one thing that caught my attention is the use of Accept and Reject activities for managing approvals. Another day, someone proposed to use Follow activity for "watching a thread".

    So now, when you receive a standard activity, you need to use increasingly complicated heuristics to figure out what the activity does, because it is not possible to infer that from its type anymore.

    This has to stop. I think we need to start giving our activities better names.

    #ActivityPub

    julian@activitypub.spaceJ mariusor@metalhead.clubM phnt@fluffytail.orgP 3 Replies Last reply
    0
    • silverpill@mitra.socialS silverpill@mitra.social

      I've been reviewing the new FEP from the Mastodon team today, and one thing that caught my attention is the use of Accept and Reject activities for managing approvals. Another day, someone proposed to use Follow activity for "watching a thread".

      So now, when you receive a standard activity, you need to use increasingly complicated heuristics to figure out what the activity does, because it is not possible to infer that from its type anymore.

      This has to stop. I think we need to start giving our activities better names.

      #ActivityPub

      julian@activitypub.spaceJ This user is from outside of this forum
      julian@activitypub.spaceJ This user is from outside of this forum
      julian@activitypub.space
      wrote last edited by
      #2

      I see this from the other direction — I think it's great that we have a unified vocabulary for approvals and rejections. Why would we need a separate FeaturedItemAccept when Accept will do nicely?

      From a code organization perspective it's as complicated as you make it. For the more overloaded activities, a switch..case separates out discrete logic into physically different blocks. You could break that out to separate functions for organization.

      Once an activity handles more than one or two variants you begin to learn to make fewer assumptions based on type <img class="not-responsive emoji" src="https://activitypub.space/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60f.png?v=8aecdd5494b" title="😏" />

      1 Reply Last reply
      0
      • ? Guest crossposted this topic to General Discussion
      • silverpill@mitra.socialS silverpill@mitra.social

        I've been reviewing the new FEP from the Mastodon team today, and one thing that caught my attention is the use of Accept and Reject activities for managing approvals. Another day, someone proposed to use Follow activity for "watching a thread".

        So now, when you receive a standard activity, you need to use increasingly complicated heuristics to figure out what the activity does, because it is not possible to infer that from its type anymore.

        This has to stop. I think we need to start giving our activities better names.

        #ActivityPub

        mariusor@metalhead.clubM This user is from outside of this forum
        mariusor@metalhead.clubM This user is from outside of this forum
        mariusor@metalhead.club
        wrote last edited by
        #3

        @silverpill I think you're wrong. It feels perfectly natural that the same activity can be used with different objects. That's the whole purpose of the Activity vocabulary itself being split between activities and objects, isn't it?

        And yes, that sometimes means that different side-effects need to be implemented for processing the same type of activity.

        silverpill@mitra.socialS 1 Reply Last reply
        1
        • silverpill@mitra.socialS silverpill@mitra.social

          I've been reviewing the new FEP from the Mastodon team today, and one thing that caught my attention is the use of Accept and Reject activities for managing approvals. Another day, someone proposed to use Follow activity for "watching a thread".

          So now, when you receive a standard activity, you need to use increasingly complicated heuristics to figure out what the activity does, because it is not possible to infer that from its type anymore.

          This has to stop. I think we need to start giving our activities better names.

          #ActivityPub

          phnt@fluffytail.orgP This user is from outside of this forum
          phnt@fluffytail.orgP This user is from outside of this forum
          phnt@fluffytail.org
          wrote last edited by
          #4
          @silverpill
          >And one thing that caught my attention is the use of Accept and Reject activities for managing approvals.

          This is an ActivityPub issue more than anything else. The "spec" is clear that the side-effects are to be determined by the type of the Object. There is no other indication, you effectively must check the type of the Object referenced. And I think that is correct, the same way Mastodon is correct in its usage of these two Activity types.

          If you split the type for other Accept/Reject Activities, like AcceptFeatured or whatever, you are still left with more type determining logic anyway [at least in function non-pattern matching languages :)]. You just moved it somewhere else instead.
          lain@lain.comL silverpill@mitra.socialS 2 Replies Last reply
          0
          • phnt@fluffytail.orgP phnt@fluffytail.org
            @silverpill
            >And one thing that caught my attention is the use of Accept and Reject activities for managing approvals.

            This is an ActivityPub issue more than anything else. The "spec" is clear that the side-effects are to be determined by the type of the Object. There is no other indication, you effectively must check the type of the Object referenced. And I think that is correct, the same way Mastodon is correct in its usage of these two Activity types.

            If you split the type for other Accept/Reject Activities, like AcceptFeatured or whatever, you are still left with more type determining logic anyway [at least in function non-pattern matching languages :)]. You just moved it somewhere else instead.
            lain@lain.comL This user is from outside of this forum
            lain@lain.comL This user is from outside of this forum
            lain@lain.com
            wrote last edited by
            #5
            @phnt @silverpill looking forward to the first activity with an array of types targeting an object with an array of types
            phnt@fluffytail.orgP 1 Reply Last reply
            1
            • silverpill@mitra.socialS This user is from outside of this forum
              silverpill@mitra.socialS This user is from outside of this forum
              silverpill@mitra.social
              wrote last edited by
              #6

              Do you also use the same 10 names for all variables in your code?

              1 Reply Last reply
              0
              • lain@lain.comL lain@lain.com
                @phnt @silverpill looking forward to the first activity with an array of types targeting an object with an array of types
                phnt@fluffytail.orgP This user is from outside of this forum
                phnt@fluffytail.orgP This user is from outside of this forum
                phnt@fluffytail.org
                wrote last edited by
                #7
                @lain @silverpill Somebody probably made that already. Objects with type arrays have been talked about recently-ish I think. Those are even more insane and should be made into a specific type instead.

                https://codeberg.org/fediverse/fep/src/branch/main/fep/2277/fep-2277.md#multi-typing
                silverpill@mitra.socialS 1 Reply Last reply
                0
                • phnt@fluffytail.orgP phnt@fluffytail.org
                  @silverpill
                  >And one thing that caught my attention is the use of Accept and Reject activities for managing approvals.

                  This is an ActivityPub issue more than anything else. The "spec" is clear that the side-effects are to be determined by the type of the Object. There is no other indication, you effectively must check the type of the Object referenced. And I think that is correct, the same way Mastodon is correct in its usage of these two Activity types.

                  If you split the type for other Accept/Reject Activities, like AcceptFeatured or whatever, you are still left with more type determining logic anyway [at least in function non-pattern matching languages :)]. You just moved it somewhere else instead.
                  silverpill@mitra.socialS This user is from outside of this forum
                  silverpill@mitra.socialS This user is from outside of this forum
                  silverpill@mitra.social
                  wrote last edited by
                  #8

                  @phnt With AcceptFeatured you don't need to determine anything. Because the object type is right here in the activity name

                  phnt@fluffytail.orgP raphael@mastodon.communick.comR 2 Replies Last reply
                  0
                  • phnt@fluffytail.orgP phnt@fluffytail.org
                    @lain @silverpill Somebody probably made that already. Objects with type arrays have been talked about recently-ish I think. Those are even more insane and should be made into a specific type instead.

                    https://codeberg.org/fediverse/fep/src/branch/main/fep/2277/fep-2277.md#multi-typing
                    silverpill@mitra.socialS This user is from outside of this forum
                    silverpill@mitra.socialS This user is from outside of this forum
                    silverpill@mitra.social
                    wrote last edited by
                    #9

                    @phnt @lain Not long ago I saw a Create activity from Cookifed and the object type was ["Note", "Baking"].

                    lain@lain.comL phnt@fluffytail.orgP 2 Replies Last reply
                    0
                    • silverpill@mitra.socialS silverpill@mitra.social

                      @phnt With AcceptFeatured you don't need to determine anything. Because the object type is right here in the activity name

                      phnt@fluffytail.orgP This user is from outside of this forum
                      phnt@fluffytail.orgP This user is from outside of this forum
                      phnt@fluffytail.org
                      wrote last edited by
                      #10
                      @silverpill You ideally should verify that AcceptFeatured refers to the type of the Object as expected, effectively doing the same thing anyway. You also need to add that as a supported type to your Acccept/Reject validator since they are basically the same, you have to modify your activity builder, if you have one, to create these new types if you wish to support creation and not just ingestion.

                      So instead of some long switch/case statement on an Object type, you now have a long list of Accept*/Reject* types that all have the same semantics just operating on different types. And more handling in your validators/builders.

                      The same argument can be made about Create/Update Activities which operate on a bunch of Object types. CreateNote/UpdateNote/UpdateActor/... doesn't make sense in my head as well.
                      silverpill@mitra.socialS 1 Reply Last reply
                      1
                      • silverpill@mitra.socialS silverpill@mitra.social

                        @phnt @lain Not long ago I saw a Create activity from Cookifed and the object type was ["Note", "Baking"].

                        lain@lain.comL This user is from outside of this forum
                        lain@lain.comL This user is from outside of this forum
                        lain@lain.com
                        wrote last edited by
                        #11
                        @silverpill @phnt amazing
                        1 Reply Last reply
                        1
                        • silverpill@mitra.socialS silverpill@mitra.social

                          @phnt @lain Not long ago I saw a Create activity from Cookifed and the object type was ["Note", "Baking"].

                          phnt@fluffytail.orgP This user is from outside of this forum
                          phnt@fluffytail.orgP This user is from outside of this forum
                          phnt@fluffytail.org
                          wrote last edited by
                          #12
                          @silverpill @lain Use case for type=recipe not found.

                          >Cookifed is a free and federated recipes management app and cooking social network. Using ActivityPub, users can share their recipes publicly or just with friends across multiple instances.

                          Actually not a bad idea considering the current state of recipe sites.
                          1 Reply Last reply
                          0
                          • silverpill@mitra.socialS silverpill@mitra.social

                            @phnt With AcceptFeatured you don't need to determine anything. Because the object type is right here in the activity name

                            raphael@mastodon.communick.comR This user is from outside of this forum
                            raphael@mastodon.communick.comR This user is from outside of this forum
                            raphael@mastodon.communick.com
                            wrote last edited by
                            #13

                            @silverpill @phnt

                            What is the practical difference between having to agree on the meaning of "Type + verb" vs "VerbType"?

                            silverpill@mitra.socialS 1 Reply Last reply
                            1
                            • mariusor@metalhead.clubM mariusor@metalhead.club

                              @silverpill I think you're wrong. It feels perfectly natural that the same activity can be used with different objects. That's the whole purpose of the Activity vocabulary itself being split between activities and objects, isn't it?

                              And yes, that sometimes means that different side-effects need to be implemented for processing the same type of activity.

                              silverpill@mitra.socialS This user is from outside of this forum
                              silverpill@mitra.socialS This user is from outside of this forum
                              silverpill@mitra.social
                              wrote last edited by
                              #14

                              @mariusor Wrong about what, using different names for different things?

                              Only a few activities from Activity vocabulary work well with any type of object. For example Create and Update.

                              mariusor@metalhead.clubM 1 Reply Last reply
                              0
                              • phnt@fluffytail.orgP phnt@fluffytail.org
                                @silverpill You ideally should verify that AcceptFeatured refers to the type of the Object as expected, effectively doing the same thing anyway. You also need to add that as a supported type to your Acccept/Reject validator since they are basically the same, you have to modify your activity builder, if you have one, to create these new types if you wish to support creation and not just ingestion.

                                So instead of some long switch/case statement on an Object type, you now have a long list of Accept*/Reject* types that all have the same semantics just operating on different types. And more handling in your validators/builders.

                                The same argument can be made about Create/Update Activities which operate on a bunch of Object types. CreateNote/UpdateNote/UpdateActor/... doesn't make sense in my head as well.
                                silverpill@mitra.socialS This user is from outside of this forum
                                silverpill@mitra.socialS This user is from outside of this forum
                                silverpill@mitra.social
                                wrote last edited by
                                #15

                                @phnt

                                You ideally should verify that AcceptFeatured refers to the type of the Object as expected, effectively doing the same thing anyway.

                                It is not the same thing because you skip one expensive operation: determining the subtype of activity.

                                You also need to add that as a supported type to your Acccept/Reject validator since they are basically the same, you have to modify your activity builder, if you have one, to create these new types if you wish to support creation and not just ingestion.

                                Is that a problem? I already have different parsers and different builders for different activities.

                                The same argument can be made about Create/Update Activities which operate on a bunch of Object types. CreateNote/UpdateNote/UpdateActor/... doesn't make sense in my head as well.

                                Create and Update have an embedded object, so they do not require specialized names.

                                1 Reply Last reply
                                0
                                • silverpill@mitra.socialS silverpill@mitra.social

                                  @mariusor Wrong about what, using different names for different things?

                                  Only a few activities from Activity vocabulary work well with any type of object. For example Create and Update.

                                  mariusor@metalhead.clubM This user is from outside of this forum
                                  mariusor@metalhead.clubM This user is from outside of this forum
                                  mariusor@metalhead.club
                                  wrote last edited by
                                  #16

                                  @silverpill wrong about thinking that the activity type is the only meaningful information about the side-effect of its reception.

                                  The official specification already has a case where Create/Delete have slightly different logic based on their objects:

                                  https://www.w3.org/TR/activitystreams-vocabulary/#h-motivations-crud

                                  vs.

                                  https://www.w3.org/TR/activitystreams-vocabulary/#h-motivations-relationships

                                  PS. I'm not defending the Mastodon FEP, but clarifying that the underlying assumption of using existing vocabulary for what is basically the same operation, be it on different object types, makes sense.

                                  silverpill@mitra.socialS 1 Reply Last reply
                                  0
                                  • raphael@mastodon.communick.comR raphael@mastodon.communick.com

                                    @silverpill @phnt

                                    What is the practical difference between having to agree on the meaning of "Type + verb" vs "VerbType"?

                                    silverpill@mitra.socialS This user is from outside of this forum
                                    silverpill@mitra.socialS This user is from outside of this forum
                                    silverpill@mitra.social
                                    wrote last edited by
                                    #17

                                    @raphael @phnt I don't think there is a difference.

                                    raphael@mastodon.communick.comR 1 Reply Last reply
                                    0
                                    • silverpill@mitra.socialS silverpill@mitra.social

                                      @raphael @phnt I don't think there is a difference.

                                      raphael@mastodon.communick.comR This user is from outside of this forum
                                      raphael@mastodon.communick.comR This user is from outside of this forum
                                      raphael@mastodon.communick.com
                                      wrote last edited by
                                      #18

                                      @silverpill @phnt

                                      So doesn't it mean that, in practice, your objection to the FEP is purely about your personal preference?

                                      silverpill@mitra.socialS 1 Reply Last reply
                                      1
                                      • mariusor@metalhead.clubM mariusor@metalhead.club

                                        @silverpill wrong about thinking that the activity type is the only meaningful information about the side-effect of its reception.

                                        The official specification already has a case where Create/Delete have slightly different logic based on their objects:

                                        https://www.w3.org/TR/activitystreams-vocabulary/#h-motivations-crud

                                        vs.

                                        https://www.w3.org/TR/activitystreams-vocabulary/#h-motivations-relationships

                                        PS. I'm not defending the Mastodon FEP, but clarifying that the underlying assumption of using existing vocabulary for what is basically the same operation, be it on different object types, makes sense.

                                        silverpill@mitra.socialS This user is from outside of this forum
                                        silverpill@mitra.socialS This user is from outside of this forum
                                        silverpill@mitra.social
                                        wrote last edited by
                                        #19

                                        @mariusor Activity type is not the only meaningful information about the side-effect, but in many cases a custom type could help with the identification.

                                        1 Reply Last reply
                                        0
                                        • raphael@mastodon.communick.comR raphael@mastodon.communick.com

                                          @silverpill @phnt

                                          So doesn't it mean that, in practice, your objection to the FEP is purely about your personal preference?

                                          silverpill@mitra.socialS This user is from outside of this forum
                                          silverpill@mitra.socialS This user is from outside of this forum
                                          silverpill@mitra.social
                                          wrote last edited by
                                          #20

                                          @raphael @phnt In a way, yes. My personal preferences:

                                          1) self-describing objects (better DX)
                                          2) more efficient processing

                                          julian@activitypub.spaceJ 1 Reply Last reply
                                          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