Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support Lemmy #372

Open
snarfed opened this issue Jan 17, 2023 · 8 comments
Open

support Lemmy #372

snarfed opened this issue Jan 17, 2023 · 8 comments

Comments

@snarfed
Copy link
Owner

snarfed commented Jan 17, 2023

Background:

I tried federating this like 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.

Lemmy's design looks like Reddit, with up/downvotes instead of likes, so I don't know that it actually 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.

{
  "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
Copy link
Owner Author

snarfed commented Jan 20, 2023

From https://socialhub.activitypub.rocks/t/help-improving-federation-between-lemmy-and-other-projects/2308/22 :

You are right this isnt complicated, in fact we are already doing the same thing in some other places. Unfortunately I dont have time to work on this, but if you want to make a contribution I would gladly guide you through the code.

@snarfed
Copy link
Owner Author

snarfed commented Oct 12, 2023

Progress is a new error message. After #442, we're now getting HTTP 400 data did not match any variant of untagged enum PersonOrGroup on this Like:

{
  "published": "2023-10-11T21:12:28-07:00",
  "content": "Likes <a class=\"u-like-of\" href=\"https://lemmy.world/post/6663494\">https://lemmy.world/post/6663494</a>;..\n<div class=\"e-content\">\nA meme for math people – Lemmy.world\n</div>",
  "url": "https://fed.brid.gy/r/https://snarfed.org/2023-10-11_a-meme-for-math-people-lemmy-world",
  "actor": "https://fed.brid.gy/snarfed.org",
  "id": "https://fed.brid.gy/r/https://snarfed.org/2023-10-11_a-meme-for-math-people-lemmy-world",
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Like",
  "object": "https://lemmy.world/post/6663494",
  "cc": [
    "https://lemmy.ml/c/memes",
    "https://lemmy.world/u/hypertown",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ]
}

@snarfed
Copy link
Owner Author

snarfed commented Oct 12, 2023

And for this reply, 400 Client Error: Bad Request for url: https://lemmy.world/u/hypertown/inbox ; deserializing body: ...

{
  "id": "https://fed.brid.gy/r/https://snarfed.org/2023-10-11_a-meme-for-math-people-lemmy-world-3#bridgy-fed-create",
  "actor": "https://fed.brid.gy/snarfed.org",
  "published": "2023-10-12T04:17:52.463875+00:00",
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "object": {
    "published": "2023-10-11T21:17:47-07:00",
    "content": "<a class=\"u-in-reply-to\" href=\"https://lemmy.world/post/6663494\"></a>\n<div class=\"e-content\">\nnice\n</div>",
    "url": "https://fed.brid.gy/r/https://snarfed.org/2023-10-11_a-meme-for-math-people-lemmy-world-3",
    "id": "https://fed.brid.gy/r/https://snarfed.org/2023-10-11_a-meme-for-math-people-lemmy-world-3",
    "type": "Note",
    "attributedTo": "https://fed.brid.gy/snarfed.org",
    "inReplyTo": "https://lemmy.world/post/6663494",
    "cc": [
      "https://lemmy.ml/c/memes",
      "https://lemmy.world/u/hypertown",
      "https://www.w3.org/ns/activitystreams#Public"
    ],
    "tag": [
      {
        "type": "Mention",
        "href": "https://lemmy.world/u/hypertown"
      }
    ],
    "to": [
      "https://www.w3.org/ns/activitystreams#Public"
    ]
  },
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ]
}

@snarfed
Copy link
Owner Author

snarfed commented Oct 24, 2023

Progress is a new error message. After #442, we're now getting HTTP 400 data did not match any variant of untagged enum PersonOrGroup on this Like:

This also happens on follows.

@gaviscapes
Copy link

Is there any progress on this at all? The recent lemmy update made some heavy changes and improved the API significantly.

@snarfed
Copy link
Owner Author

snarfed commented Jan 20, 2024

Exciting! Last I checked, we were blocked on Lemmy errors, details above. Feel free to test again and see if anything has changed!

@Nutomic
Copy link

Nutomic commented Feb 14, 2024

Lemmy maintainer here, just came across this. I threw this activity into Lemmy tests, and it fails because the Create activity is missing cc field. You need to copy that from the inner Note.

By the way, Lemmy users view Bridgy Fed generally positively, as they consider all posts to be public anyway. So theres no need for complicated opt-in solutions in case of Lemmy. Here you can see the discussion. And another one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants