lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

HTTP 400 error on inbox delivery of Like activity: "invalid type: map, expected a string representing an URL"

Open snarfed opened this issue 2 years ago • 1 comments

Hi I tried federating a Like activity from Bridgy Fed to this post on lemmy.ml (running BE 0.16.7) just now, and the AP inbox delivery to https://lemmy.ml/u/OptimusPrime/inbox returned 400 with invalid type: map, expected a string representing an URL at line 1 column 218. Bridgy Fed log here. Full AS2 object below.

I don't know that Lemmy supports likes, but the error message sounds unrelated to that, more like maybe it can only handle string URLs for actors instead of compound objects, or something similar?

Not urgent, just interop testing. Also tracking in https://github.com/snarfed/bridgy-fed/issues/372.

{
  "published": "2023-01-17T13:03:52-08:00",
  "content": "likes <a class=\"u-like u-like-of\" href=\"https://lemmy.ml/post/713841\">[lemmy.ml](http://lemmy.ml/)</a>",
  "url": "https://fed.brid.gy/r/https://snarfed.org/2023-01-17_lemmy-ml",
  "actor": {
    "url": "https://fed.brid.gy/r/https://snarfed.org/",
    "image": {
      "url": "https://secure.gravatar.com/avatar/947b5f3f323da0ef785b6f02d9c265d6?s=96&d=blank&r=g",
      "type": "Image"
    },
    "type": "Person",
    "name": "Ryan Barrett",
    "icon": {
      "url": "https://secure.gravatar.com/avatar/947b5f3f323da0ef785b6f02d9c265d6?s=96&d=blank&r=g",
      "type": "Image"
    },
    "id": "https://fed.brid.gy/snarfed.org",
    "preferredUsername": "[snarfed.org](http://snarfed.org/)"
  },
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Like",
  "object": "https://lemmy.ml/post/713841",
  "id": "https://fed.brid.gy/r/https://snarfed.org/2023-01-17_lemmy-ml",
  "cc": [
    "https://lemmy.ml/u/OptimusPrime",
    "https://lemmy.ml/c/privacy",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ]
}

snarfed avatar Jan 17 '23 21:01 snarfed

maybe it can only handle string URLs for actors instead of compound objects, or something similar?

Yup, that's it. Line 1 column 218 of the request body points to the value of the actor field.

snarfed avatar Jan 17 '23 21:01 snarfed

Ooh, was this fixed in 0.19? Looks like lemmy.ml is still on 0.18, but I'm looking forward to testing against a 0.19 instance if so!

snarfed avatar Sep 28 '23 15:09 snarfed

Its not fixed, rather this format for actor is not supported. And I dont see why it should be, considering that all major platforms federate actor as a simple id. You can see here for examples.

Nutomic avatar Sep 28 '23 20:09 Nutomic

See https://www.w3.org/TR/activitystreams-vocabulary/#dfn-actor

Both must be supported for full compliance with ActivityPub / ActivityStreams 2.0

ThisIsMissEm avatar Sep 28 '23 21:09 ThisIsMissEm

I doubt that any of the major existing platforms can claim full compliance with Activitypub. And its not a goal for Lemmy, what matters is that federation works (which it does).

Nutomic avatar Sep 29 '23 13:09 Nutomic

I doubt that any of the major existing platforms can claim full compliance with Activitypub. And its not a goal for Lemmy, what matters is that federation works (which it does).

We'll soon see, given folks are developing an ActivityPub compliance test suite.

ThisIsMissEm avatar Sep 29 '23 17:09 ThisIsMissEm