Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • 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
We Distribute
  1. Home
  2. Technical Discussion
  3. I have deeply mixed feelings about #ActivityPub's adoption of JSON-LD, as someone who's spent way too long dealing with it while building #Fedify.

I have deeply mixed feelings about #ActivityPub's adoption of JSON-LD, as someone who's spent way too long dealing with it while building #Fedify.

Scheduled Pinned Locked Moved Technical Discussion
fedifyjsonldfedidevactivitypub
168 Posts 35 Posters 266 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.
  • evan@cosocial.caE evan@cosocial.ca

    @cwebber @kopper @hongminhee It would be a huge backwards-incompatible change for almost zero benefit. People would still make mistakes in their ActivityPub implementations (sorry, Minhee, but that's life on an open network). We'd need to adopt another mechanism for defining extensions, and guess what? People are going to make mistakes with that, too.

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

    @cwebber @kopper @hongminhee The biggest downside to JSON-LD, it seems, is that it lets most developers treat AS2 as if it's plain old JSON. That was by design. People sometimes mess it up, but most JSON-LD parsers are pretty tolerant.

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

      @cwebber @kopper @hongminhee It would be a huge backwards-incompatible change for almost zero benefit. People would still make mistakes in their ActivityPub implementations (sorry, Minhee, but that's life on an open network). We'd need to adopt another mechanism for defining extensions, and guess what? People are going to make mistakes with that, too.

      kopper@not-brain.d.on-t.workK This user is from outside of this forum
      kopper@not-brain.d.on-t.workK This user is from outside of this forum
      kopper@not-brain.d.on-t.work
      wrote last edited by
      #98
      @evan @hongminhee @cwebber my argument is that json-ld is way more prone to mistakes. in iceshrimp.net, for example, we ship and preload several modified contexts in order to correct some mistakes on our end, and even then we encounter a lot of software that do not, for example, include the security context in their actors

      if, as per my suggestion, property names were always written in expanded form, the only mistakes you could really do would be typos, and that would fail pretty loudly compared to the current status quo where most software accept it and some software silently fail. how are those developers meant to even be aware that this is a problem?
      1 Reply Last reply
      0
      • evan@cosocial.caE evan@cosocial.ca

        @cwebber @kopper @hongminhee The biggest downside to JSON-LD, it seems, is that it lets most developers treat AS2 as if it's plain old JSON. That was by design. People sometimes mess it up, but most JSON-LD parsers are pretty tolerant.

        gugurumbe@mastouille.frG This user is from outside of this forum
        gugurumbe@mastouille.frG This user is from outside of this forum
        gugurumbe@mastouille.fr
        wrote last edited by
        #99

        @evan @cwebber @kopper @hongminhee Couldn’t we agree to standardize on expanded json-ld? We would not need any json-ld processor, we would not need to fetch or cache any context. There would be no way to shadow properties.

        kopper@not-brain.d.on-t.workK evan@cosocial.caE 2 Replies Last reply
        0
        • gugurumbe@mastouille.frG gugurumbe@mastouille.fr

          @evan @cwebber @kopper @hongminhee Couldn’t we agree to standardize on expanded json-ld? We would not need any json-ld processor, we would not need to fetch or cache any context. There would be no way to shadow properties.

          kopper@not-brain.d.on-t.workK This user is from outside of this forum
          kopper@not-brain.d.on-t.workK This user is from outside of this forum
          kopper@not-brain.d.on-t.work
          wrote last edited by
          #100
          @gugurumbe @hongminhee @evan @cwebber

          from my brief tests, compacting with no context (which is basically expanded json-ld, with very minor differences) compresses better, but standardizing on expanded ld would still be better than the status quo. yes backwards compatibility would be broken, but pretty much any other solution to this problem beyond not solving it would end up breaking it anyway

          i'm still unsure about certain aspects of json-ld such as everything having the capability for multiple values, but without any context defined it's at least explicit and implementations can take that into account where it's actually helpful (
          sec:publicKey comes to mind) and ignore it where it isn't

          (
          edit: ignore the last part, i just re-checked and compact-with-no-context collapses arrays with single values, expanded would be clearer here)

          RE:
          not-brain.d.on-t.work/notes/aihftmbjpxdyb9k7
          1 Reply Last reply
          0
          • gugurumbe@mastouille.frG gugurumbe@mastouille.fr

            @evan @cwebber @kopper @hongminhee Couldn’t we agree to standardize on expanded json-ld? We would not need any json-ld processor, we would not need to fetch or cache any context. There would be no way to shadow properties.

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

            @gugurumbe @cwebber @kopper @hongminhee AS2 requires compacted JSON-LD.

            evan@cosocial.caE trwnh@mastodon.socialT 2 Replies Last reply
            0
            • evan@cosocial.caE evan@cosocial.ca

              @gugurumbe @cwebber @kopper @hongminhee AS2 requires compacted JSON-LD.

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

              There is no data format we can choose to eliminate programmer errors in online protocols. That's a quixotic aim.

              @gugurumbe @cwebber @kopper @hongminhee

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

                There is no data format we can choose to eliminate programmer errors in online protocols. That's a quixotic aim.

                @gugurumbe @cwebber @kopper @hongminhee

                gugurumbe@mastouille.frG This user is from outside of this forum
                gugurumbe@mastouille.frG This user is from outside of this forum
                gugurumbe@mastouille.fr
                wrote last edited by
                #103

                @evan @kopper mentioned the async problem; if there’s no external contexts to fetch, then the recieving server can explicitly reject the request if it is incorrect.

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

                  @cwebber @kopper @hongminhee It would be a huge backwards-incompatible change for almost zero benefit. People would still make mistakes in their ActivityPub implementations (sorry, Minhee, but that's life on an open network). We'd need to adopt another mechanism for defining extensions, and guess what? People are going to make mistakes with that, too.

                  ? Offline
                  ? Offline
                  Guest
                  wrote last edited by
                  #104

                  @evan @cwebber @kopper @hongminhee maybe a compromise approach could be to specify a simpler “json-ld as it is used in practice”, similar to what HTML5 was, that remains backward compatible while simplifying the spec to the point that it is actually feasible to implement

                  1 Reply Last reply
                  0
                  • gugurumbe@mastouille.frG gugurumbe@mastouille.fr

                    @evan @kopper mentioned the async problem; if there’s no external contexts to fetch, then the recieving server can explicitly reject the request if it is incorrect.

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

                    @gugurumbe @kopper I don't think that's the model of ActivityPub. It's made to allow reading remote objects.

                    Most implementations pre-load or compile in the external contexts. I agree, it's a big performance hit to load context URLs at runtime.

                    kopper@not-brain.d.on-t.workK 1 Reply Last reply
                    0
                    • evan@cosocial.caE evan@cosocial.ca

                      @gugurumbe @kopper I don't think that's the model of ActivityPub. It's made to allow reading remote objects.

                      Most implementations pre-load or compile in the external contexts. I agree, it's a big performance hit to load context URLs at runtime.

                      kopper@not-brain.d.on-t.workK This user is from outside of this forum
                      kopper@not-brain.d.on-t.workK This user is from outside of this forum
                      kopper@not-brain.d.on-t.work
                      wrote last edited by
                      #106
                      @evan @gugurumbe it's infeasible to preload all contexts, pretty much every pleroma instance hosts their own context on their own instance for example. then there is the obvious interop problems of how to handle contexts for new extensions your software is not aware of (though pretending like they're empty might work i guess?)
                      gugurumbe@mastouille.frG evan@cosocial.caE trwnh@mastodon.socialT 3 Replies Last reply
                      0
                      • evan@cosocial.caE evan@cosocial.ca

                        @cwebber @kopper @hongminhee

                        I would be strongly opposed to any effort to remove JSON-LD from AS2. We use it for a lot of extensions. Every AP server uses the Security vocabulary for public keys.

                        cwebber@social.coopC This user is from outside of this forum
                        cwebber@social.coopC This user is from outside of this forum
                        cwebber@social.coop
                        wrote last edited by
                        #107

                        @evan @kopper @hongminhee The problem is that signing json-ld is extremely hard, because effectively you have to turn to the RDF graph normalization algorithm, which has extremely expensive compute times. The lack of signatures means that when I boost peoples' posts, it takes down their instance, since effectively *every* distributed post on the network doesn't actually get accepted as-is, users dial-back to check its contents.

                        Which, at that point, we might as well not distribute the contents at all when we post to inboxes! We could just publish with the object of the activity being the object's id uri

                        kopper@not-brain.d.on-t.workK evan@cosocial.caE smallcircles@social.coopS rigo@mamot.frR 4 Replies Last reply
                        0
                        • cwebber@social.coopC cwebber@social.coop

                          @evan @kopper @hongminhee The problem is that signing json-ld is extremely hard, because effectively you have to turn to the RDF graph normalization algorithm, which has extremely expensive compute times. The lack of signatures means that when I boost peoples' posts, it takes down their instance, since effectively *every* distributed post on the network doesn't actually get accepted as-is, users dial-back to check its contents.

                          Which, at that point, we might as well not distribute the contents at all when we post to inboxes! We could just publish with the object of the activity being the object's id uri

                          kopper@not-brain.d.on-t.workK This user is from outside of this forum
                          kopper@not-brain.d.on-t.workK This user is from outside of this forum
                          kopper@not-brain.d.on-t.work
                          wrote last edited by
                          #108
                          @cwebber @hongminhee @evan admittedly, codeberg.org/fediverse/fep/src/branch/main/fep/8b32/fep-8b32.md does kind of solve this specific problem. the json canonicalization used there is much lighter than rdf canonicalization (which iceshrimp had to implement in dotNetRdf specifically for its ld signature support, so tooling availability is not really an excuse in favor of json-ld either!)
                          cwebber@social.coopC 1 Reply Last reply
                          0
                          • kopper@not-brain.d.on-t.workK kopper@not-brain.d.on-t.work
                            @cwebber @hongminhee @evan admittedly, codeberg.org/fediverse/fep/src/branch/main/fep/8b32/fep-8b32.md does kind of solve this specific problem. the json canonicalization used there is much lighter than rdf canonicalization (which iceshrimp had to implement in dotNetRdf specifically for its ld signature support, so tooling availability is not really an excuse in favor of json-ld either!)
                            cwebber@social.coopC This user is from outside of this forum
                            cwebber@social.coopC This user is from outside of this forum
                            cwebber@social.coop
                            wrote last edited by
                            #109

                            @kopper @hongminhee @evan Interesting... I guess it means you can't re-compact with a new outer context, but maybe that's fine

                            1 Reply Last reply
                            0
                            • cwebber@social.coopC cwebber@social.coop

                              @evan @kopper @hongminhee The problem is that signing json-ld is extremely hard, because effectively you have to turn to the RDF graph normalization algorithm, which has extremely expensive compute times. The lack of signatures means that when I boost peoples' posts, it takes down their instance, since effectively *every* distributed post on the network doesn't actually get accepted as-is, users dial-back to check its contents.

                              Which, at that point, we might as well not distribute the contents at all when we post to inboxes! We could just publish with the object of the activity being the object's id uri

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

                              @cwebber @kopper @hongminhee I talk about this in my book. Unless the receiving user is online at the time the server receives the Announce, it's ridiculous to fetch the content immediately. Receiving servers should pause a random number of minutes and then fetch the content. It avoids the thundering herd problem.

                              patmikemid@sfba.socialP julia@eepy.moeJ cwebber@social.coopC 3 Replies Last reply
                              0
                              • evan@cosocial.caE evan@cosocial.ca

                                @cwebber @kopper @hongminhee I talk about this in my book. Unless the receiving user is online at the time the server receives the Announce, it's ridiculous to fetch the content immediately. Receiving servers should pause a random number of minutes and then fetch the content. It avoids the thundering herd problem.

                                patmikemid@sfba.socialP This user is from outside of this forum
                                patmikemid@sfba.socialP This user is from outside of this forum
                                patmikemid@sfba.social
                                wrote last edited by
                                #111

                                @evan @cwebber @kopper @hongminhee I think that is a better algorithm than a brain dead exponential back off. Perhaps put the two together.

                                evan@cosocial.caE 1 Reply Last reply
                                0
                                • kopper@not-brain.d.on-t.workK kopper@not-brain.d.on-t.work
                                  @evan @gugurumbe it's infeasible to preload all contexts, pretty much every pleroma instance hosts their own context on their own instance for example. then there is the obvious interop problems of how to handle contexts for new extensions your software is not aware of (though pretending like they're empty might work i guess?)
                                  gugurumbe@mastouille.frG This user is from outside of this forum
                                  gugurumbe@mastouille.frG This user is from outside of this forum
                                  gugurumbe@mastouille.fr
                                  wrote last edited by
                                  #112

                                  @kopper It does not; if a malicious context redefines the security properties then the JSON-LD processor will understand the data differently than the unaware processor.

                                  1 Reply Last reply
                                  0
                                  • patmikemid@sfba.socialP patmikemid@sfba.social

                                    @evan @cwebber @kopper @hongminhee I think that is a better algorithm than a brain dead exponential back off. Perhaps put the two together.

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

                                    @patmikemid I call it trust, then verify. Usually caching the data with a ttl of a short number of minutes is enough.

                                    @cwebber @kopper @hongminhee

                                    cwebber@social.coopC 1 Reply Last reply
                                    0
                                    • kopper@not-brain.d.on-t.workK kopper@not-brain.d.on-t.work
                                      @evan @gugurumbe it's infeasible to preload all contexts, pretty much every pleroma instance hosts their own context on their own instance for example. then there is the obvious interop problems of how to handle contexts for new extensions your software is not aware of (though pretending like they're empty might work i guess?)
                                      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
                                      #114

                                      @kopper @gugurumbe

                                      https://en.wikipedia.org/wiki/Cache_%28computing%29

                                      kopper@not-brain.d.on-t.workK natty@astolfo.socialN mia@void.rehabM 3 Replies Last reply
                                      0
                                      • evan@cosocial.caE evan@cosocial.ca

                                        @kopper @gugurumbe

                                        https://en.wikipedia.org/wiki/Cache_%28computing%29

                                        kopper@not-brain.d.on-t.workK This user is from outside of this forum
                                        kopper@not-brain.d.on-t.workK This user is from outside of this forum
                                        kopper@not-brain.d.on-t.work
                                        wrote last edited by
                                        #115
                                        @evan @gugurumbe i know what caching is, thanks. in fact, my current project is building one that's tailor made for solving the activitypub thundering herd problem (codeberg.org/KittyShopper/middleap)

                                        i've been trying to keep civil through this thread largely because i started the conversation mentioning software i (temporarily) help maintain and therefore represent it even implicitly, but leaving that aside and letting my own personal thoughts enter the picture:

                                        i think this passive aggressive reply is the last straw. thinking that i somehow know enough to write code for this protocol without knowing what a cache is? plugging your book in a network largely developed by poor minorities (i myself have the rough equivalent of less than 40 USD in my bank account total)? this inability to consider change? ("as2 requires compaction",
                                        because you're the one defining the spec saying it does), the inability to consider the people and software producing and building upon the data, as opposed to the data itself? the inability to consider the consequences of your specifications and how they're being used in the real world?

                                        i honestly do not know if this line of thought is truly capable of leading this protocol out the slump it's currently in. if you're insistent on shooting yourself in the foot, so be it, but please take the time to consider how this behavior affects other people.

                                        i've largely been burnt out of interacting in socialhub and other official protocol communities due to exactly this behavior, whether from you or others with influence on the final specs, and the only reason i keep trying is because of what's probably a self-destructive autistic hyperfixation on this niche network and trying to make it actually work for me and my friends, as opposed to
                                        receiving funding from the well-known genocide enablers at meta and trying to shove failing standards where they don't belong.

                                        please be a better example. if the protocol was actually desirable then sure, you may have earnt it, after all, atproto is teeming with silicon valley e/acc death cult weirdos and yet people seem to prefer it. have you wondered why?
                                        or do you prefer to dismiss anything not coming from you without thinking about it
                                        esm@wetdry.worldE evan@cosocial.caE 2 Replies Last reply
                                        0
                                        • evan@cosocial.caE evan@cosocial.ca

                                          @cwebber @kopper @hongminhee I talk about this in my book. Unless the receiving user is online at the time the server receives the Announce, it's ridiculous to fetch the content immediately. Receiving servers should pause a random number of minutes and then fetch the content. It avoids the thundering herd problem.

                                          julia@eepy.moeJ This user is from outside of this forum
                                          julia@eepy.moeJ This user is from outside of this forum
                                          julia@eepy.moe
                                          wrote last edited by
                                          #116

                                          @evan@cosocial.ca @cwebber@social.coop @kopper@not-brain.d.on-t.work @hongminhee@hollo.social shared inboxes are a thing, Evan

                                          The protocol isn't
                                          just how it was initially defined. Protocols evolve and change from their ideals to fit the needs of their operation, and getting rid of individual inboxes is one of those changes.

                                          Social media platforms are real-time- you can't just defer stuff like that.

                                          evan@cosocial.caE 1 Reply Last reply
                                          0
                                          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