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

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. I hope more #ActivityPub implementations start properly handling JSON-LD documents in various forms, rather than using ad-hoc approaches like only allowing specific fields to accept both arrays and scalar values.

I hope more #ActivityPub implementations start properly handling JSON-LD documents in various forms, rather than using ad-hoc approaches like only allowing specific fields to accept both arrays and scalar values.

Scheduled Pinned Locked Moved Uncategorized
activitypub
26 Posts 10 Posters 104 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.
  • hongminhee@hollo.socialH This user is from outside of this forum
    hongminhee@hollo.socialH This user is from outside of this forum
    hongminhee@hollo.social
    wrote last edited by
    #1

    I hope more #ActivityPub implementations start properly handling JSON-LD documents in various forms, rather than using ad-hoc approaches like only allowing specific fields to accept both arrays and scalar values.

    1 Reply Last reply
    1
    2
    • System shared this topic
    • hongminhee@hollo.socialH This user is from outside of this forum
      hongminhee@hollo.socialH This user is from outside of this forum
      hongminhee@hollo.social
      wrote last edited by
      #2

      Or, just use a proper JSON-LD processor altogether. Of course, there would be a performance penalty. The #ActivityPub spec explicitly allows as:Public or bare Public for public addressing in to/cc, etc., but surprisingly many implementations don't handle this. All of this would actually be solved by using a JSON-LD processor.

      1 Reply Last reply
      1
      3
      • hongminhee@hollo.socialH This user is from outside of this forum
        hongminhee@hollo.socialH This user is from outside of this forum
        hongminhee@hollo.social
        wrote last edited by
        #3

        Honestly, I don't really care what strategy other #ActivityPub implementations follow to comply with the spec. (I solved it in #Fedify by just using a proper JSON-LD processor.) It's just a bit annoying that I always send valid JSON-LD documents, but whenever I encounter an interoperability bug where the other side can't process them, I'm the one who has to send them a patch to fix it. 😩

        1 Reply Last reply
        1
        1
        • jamie@zomglol.wtfJ This user is from outside of this forum
          jamie@zomglol.wtfJ This user is from outside of this forum
          jamie@zomglol.wtf
          wrote last edited by
          #4

          @hongminhee I ran into things like this with Mastodon. I send valid AP activities but if I don’t encode them in a specific way, Mastodon silently ignores them. Like how it assumes the object of a Create activity must be inline and not a reference, but the actor must be a reference and not inline.

          hongminhee@hollo.socialH 1 Reply Last reply
          0
          • jamie@zomglol.wtfJ jamie@zomglol.wtf

            @hongminhee I ran into things like this with Mastodon. I send valid AP activities but if I don’t encode them in a specific way, Mastodon silently ignores them. Like how it assumes the object of a Create activity must be inline and not a reference, but the actor must be a reference and not inline.

            hongminhee@hollo.socialH This user is from outside of this forum
            hongminhee@hollo.socialH This user is from outside of this forum
            hongminhee@hollo.social
            wrote last edited by
            #5

            @jamie@zomglol.wtf Yeah, exactly such kind of thing!

            1 Reply Last reply
            2
            0
            • R relay@relay.mycrowd.ca shared this topic
            • ? Offline
              ? Offline
              Guest
              wrote last edited by
              #6

              @hongminhee

              Why don't you fix your software instead?

              It sounds like you're referring to this issue:

              Link Preview Image
              [Federation]: `Create(Note)` with a single attachment is dropped because `Helpers::verifyAttachments` still assumes `attachment` is an array (follow-up to #6427) · Issue #6588 · pixelfed/pixelfed

              Description PR #6427 made handleCreateActivity accept the JSON-LD 1.1 compact form of to/cc (single value instead of a one-element array). The same compaction rule applies to every set-valued property in Activity Streams 2.0, and one of ...

              favicon

              GitHub (github.com)

              But in Fediverse, attachment is not supposed to be an object, it's an array.

              I don't think you should expect people to comply with your vision of ActivityPub.

              hongminhee@hollo.socialH mariusor@metalhead.clubM evan@cosocial.caE profpatsch@mastodon.xyzP 4 Replies Last reply
              2
              0
              • ? Guest

                @hongminhee

                Why don't you fix your software instead?

                It sounds like you're referring to this issue:

                Link Preview Image
                [Federation]: `Create(Note)` with a single attachment is dropped because `Helpers::verifyAttachments` still assumes `attachment` is an array (follow-up to #6427) · Issue #6588 · pixelfed/pixelfed

                Description PR #6427 made handleCreateActivity accept the JSON-LD 1.1 compact form of to/cc (single value instead of a one-element array). The same compaction rule applies to every set-valued property in Activity Streams 2.0, and one of ...

                favicon

                GitHub (github.com)

                But in Fediverse, attachment is not supposed to be an object, it's an array.

                I don't think you should expect people to comply with your vision of ActivityPub.

                hongminhee@hollo.socialH This user is from outside of this forum
                hongminhee@hollo.socialH This user is from outside of this forum
                hongminhee@hollo.social
                wrote last edited by
                #7

                @silverpill@mitra.social Well, I fixed my software too:

                Link Preview Image
                Normalize outgoing JSON-LD for Pixelfed interop by dahlia · Pull Request #721 · fedify-dev/fedify

                ActivityPub server framework in TypeScript. Contribute to fedify-dev/fedify development by creating an account on GitHub.

                favicon

                GitHub (github.com)

                1 Reply Last reply
                1
                0
                • ? Offline
                  ? Offline
                  Guest
                  wrote last edited by
                  #8

                  @hongminhee Thank you

                  (my server can handle an object, but you do a favor to all who are only beginning to develop their fedi projects)

                  1 Reply Last reply
                  1
                  0
                  • ? Guest

                    @hongminhee

                    Why don't you fix your software instead?

                    It sounds like you're referring to this issue:

                    Link Preview Image
                    [Federation]: `Create(Note)` with a single attachment is dropped because `Helpers::verifyAttachments` still assumes `attachment` is an array (follow-up to #6427) · Issue #6588 · pixelfed/pixelfed

                    Description PR #6427 made handleCreateActivity accept the JSON-LD 1.1 compact form of to/cc (single value instead of a one-element array). The same compaction rule applies to every set-valued property in Activity Streams 2.0, and one of ...

                    favicon

                    GitHub (github.com)

                    But in Fediverse, attachment is not supposed to be an object, it's an array.

                    I don't think you should expect people to comply with your vision of 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
                    #9

                    > attachment is not supposed to be an object, it's an array.

                    @silverpill I don't understand how you infer that from this spec: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attachment

                    @hongminhee

                    evan@cosocial.caE ? 2 Replies Last reply
                    2
                    0
                    • evan@cosocial.caE This user is from outside of this forum
                      evan@cosocial.caE This user is from outside of this forum
                      evan@cosocial.ca
                      wrote last edited by
                      #10

                      @hongminhee so, I've been dealing with this problem a lot with tags.pub.

                      I have found that many projects are open to issues and patches. Even if I have to downgrade what I'm sending over the wire to the least common denominator, I have some hope that the next people who build to the spec will get better interoperability.

                      I think having good libraries can make the JSON-LD easier.

                      hongminhee@hollo.socialH 1 Reply Last reply
                      2
                      0
                      • ? Guest

                        @hongminhee

                        Why don't you fix your software instead?

                        It sounds like you're referring to this issue:

                        Link Preview Image
                        [Federation]: `Create(Note)` with a single attachment is dropped because `Helpers::verifyAttachments` still assumes `attachment` is an array (follow-up to #6427) · Issue #6588 · pixelfed/pixelfed

                        Description PR #6427 made handleCreateActivity accept the JSON-LD 1.1 compact form of to/cc (single value instead of a one-element array). The same compaction rule applies to every set-valued property in Activity Streams 2.0, and one of ...

                        favicon

                        GitHub (github.com)

                        But in Fediverse, attachment is not supposed to be an object, it's an array.

                        I don't think you should expect people to comply with your vision of ActivityPub.

                        evan@cosocial.caE This user is from outside of this forum
                        evan@cosocial.caE This user is from outside of this forum
                        evan@cosocial.ca
                        wrote last edited by
                        #11

                        @silverpill @hongminhee single element arrays in JSON-LD go to the element itself, not an array.

                        1 Reply Last reply
                        0
                        • evan@cosocial.caE evan@cosocial.ca

                          @hongminhee so, I've been dealing with this problem a lot with tags.pub.

                          I have found that many projects are open to issues and patches. Even if I have to downgrade what I'm sending over the wire to the least common denominator, I have some hope that the next people who build to the spec will get better interoperability.

                          I think having good libraries can make the JSON-LD easier.

                          hongminhee@hollo.socialH This user is from outside of this forum
                          hongminhee@hollo.socialH This user is from outside of this forum
                          hongminhee@hollo.social
                          wrote last edited by
                          #12

                          @evan@cosocial.ca Can't agree more.

                          I think having good libraries can make the JSON-LD easier.

                          Yeah, that's one of reasons why I started Fedify; it was started from building a type-safe Activity Vocabulary library for TypeScript which lets me free from dealing with all complicated things about JSON-LD and keeping it standard-compliant at a time!

                          1 Reply Last reply
                          2
                          0
                          • mariusor@metalhead.clubM mariusor@metalhead.club

                            > attachment is not supposed to be an object, it's an array.

                            @silverpill I don't understand how you infer that from this spec: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attachment

                            @hongminhee

                            evan@cosocial.caE This user is from outside of this forum
                            evan@cosocial.caE This user is from outside of this forum
                            evan@cosocial.ca
                            wrote last edited by
                            #13

                            @mariusor @silverpill @hongminhee yeah, that's definitely not what the spec says.

                            "The serialized JSON form of an Activity Streams 2.0 document MUST be consistent with what would be produced by the standard JSON-LD 1.0 Processing Algorithms and API [JSON-LD-API] Compaction Algorithm"

                            profpatsch@mastodon.xyzP 1 Reply Last reply
                            1
                            0
                            • evan@cosocial.caE This user is from outside of this forum
                              evan@cosocial.caE This user is from outside of this forum
                              evan@cosocial.ca
                              wrote last edited by
                              #14

                              @hongminhee So, I really appreciate that you are doing this work. I know it's hard, and it feels unrewarding, but it really matters, and it really helps the ecosystem.

                              Please let me know if I can help out in these efforts.

                              I hope that all of us in the ActivityPub community take these requests seriously when they come in.

                              1 Reply Last reply
                              2
                              0
                              • mariusor@metalhead.clubM mariusor@metalhead.club

                                > attachment is not supposed to be an object, it's an array.

                                @silverpill I don't understand how you infer that from this spec: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attachment

                                @hongminhee

                                ? Offline
                                ? Offline
                                Guest
                                wrote last edited by
                                #15

                                @mariusor @hongminhee I didn't infer that from the spec, it's how Fediverse works.

                                ? 1 Reply Last reply
                                1
                                0
                                • evan@cosocial.caE This user is from outside of this forum
                                  evan@cosocial.caE This user is from outside of this forum
                                  evan@cosocial.ca
                                  wrote last edited by
                                  #16

                                  @hongminhee the activitystrea.ms library does a pretty good job of parsing and generating AS2, in a uniform way. It pushes you into better habits, which I appreciate.

                                  My book does bare-JSON parsing in all the major examples; I should probably change it in the next version.

                                  Should we start a page for JSON-LD-based AS2 libraries? I think @cwebber did a good Python one, and there may be others.

                                  rra@post.lurk.orgR darius@friend.campD 2 Replies Last reply
                                  1
                                  0
                                  • ? Guest

                                    @mariusor @hongminhee I didn't infer that from the spec, it's how Fediverse works.

                                    ? Offline
                                    ? Offline
                                    Guest
                                    wrote last edited by
                                    #17

                                    @mariusor @hongminhee I bet the software you're using right now always sends an array

                                    mariusor@metalhead.clubM 1 Reply Last reply
                                    1
                                    0
                                    • evan@cosocial.caE evan@cosocial.ca

                                      @hongminhee the activitystrea.ms library does a pretty good job of parsing and generating AS2, in a uniform way. It pushes you into better habits, which I appreciate.

                                      My book does bare-JSON parsing in all the major examples; I should probably change it in the next version.

                                      Should we start a page for JSON-LD-based AS2 libraries? I think @cwebber did a good Python one, and there may be others.

                                      rra@post.lurk.orgR This user is from outside of this forum
                                      rra@post.lurk.orgR This user is from outside of this forum
                                      rra@post.lurk.org
                                      wrote last edited by
                                      #18

                                      @evan @hongminhee @cwebber could you share a link to that Python one?

                                      evan@cosocial.caE 1 Reply Last reply
                                      0
                                      • rra@post.lurk.orgR rra@post.lurk.org

                                        @evan @hongminhee @cwebber could you share a link to that Python one?

                                        evan@cosocial.caE This user is from outside of this forum
                                        evan@cosocial.caE This user is from outside of this forum
                                        evan@cosocial.ca
                                        wrote last edited by
                                        #19

                                        @rra @hongminhee @cwebber

                                        Link Preview Image
                                        GitHub - w3c-social/activipy: ActivityStreams 2.0 python implementation and validation lib

                                        ActivityStreams 2.0 python implementation and validation lib - w3c-social/activipy

                                        favicon

                                        GitHub (github.com)

                                        1 Reply Last reply
                                        1
                                        0
                                        • ? Guest

                                          @mariusor @hongminhee I bet the software you're using right now always sends an array

                                          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
                                          #20

                                          @silverpill I do not bow to the Mastodon imperialism.

                                          @hongminhee

                                          django@social.coopD 1 Reply Last reply
                                          2
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

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