wordpress-activitypub icon indicating copy to clipboard operation
wordpress-activitypub copied to clipboard

Comments left by mastodon do not get pushed to lemmy

Open db0 opened this issue 1 year ago • 31 comments

Quick summary

When leaving a comment to a WP post via mastodon, if that post has been federated to lemmy already, the WP comment won't be sent to the lemmy "community".

Steps to reproduce

I opened this blogpost: https://dbzer0.com/blog/this-blog-is-now-federated-natively-to-lemmy/

It got federated to lemmy here: https://lemmy.dbzer0.com/post/31734668

I left one comment from lemmy, which federated back to WP

I then replied to that comment via mastodon: https://hachyderm.io/@db0/113503918837384265

The comment appears in wordpress, correctly threaded bellow the lemmy comment. However it does not appear in the lemmy community.

What you expected to happen

Lemmy communities normally send through any comments received to all their subscribing instances. In mastodon it thus appears as if they're "boosting" all their comment. Something similar should happen in this plugin as well.

What actually happened

The comment from mastodon does not sync to lemmy.

Impact

All

Available workarounds?

No but the platform is still usable

Logs or notes

No response

db0 avatar Nov 18 '24 12:11 db0

You have to report that issue to Mastodon and/or Lemmy then, because WordPress is not involved in that scenario! Mastodon directly sends the reply to all recipients.

[update]

...or maybe let me think about this a bit first 🤔

pfefferle avatar Nov 18 '24 13:11 pfefferle

I think the way it works in lemmy proper is that when a community gets a new comment, the instance owning that community also pushes it to other subscribed instances. So I can't imagine WP failing to do the same is a lemmy issue.

@nutomic, thoughts?

db0 avatar Nov 18 '24 13:11 db0

Correct, it should be like this: Mastodon sends Create/Note to Wordpress, then Wordpress wraps it in Announce and sends the Announce/Create/Note activity to all followers.

Nutomic avatar Nov 18 '24 13:11 Nutomic

OK, THEN it is a WordPress issue 😏

Thanks @Nutomic 👍

pfefferle avatar Nov 18 '24 14:11 pfefferle

@pfefferle What would be the best way to solve this? Happy to take a stab at this

obenland avatar Dec 06 '24 19:12 obenland

Outbox! 😉

pfefferle avatar Dec 06 '24 21:12 pfefferle

@Nutomic is this a public Announce? or (as with in the spec) it does not have an audience?

I ask because otherwise Mastodon might show the Announce as a boost!?!

pfefferle avatar Feb 13 '25 16:02 pfefferle

Not sure what youre asking, which activity are you referring to specifically? And I cant tell you how Mastodon renders things.

Nutomic avatar Feb 14 '25 14:02 Nutomic

@pfefferle @db0 With the Outbox shipped, is this one fixed?

obenland avatar Mar 27 '25 14:03 obenland

@obenland no, we would have to announce every incoming comment.

pfefferle avatar Mar 27 '25 14:03 pfefferle

Is this what you'd expect that to look like? https://obietester.blog/?post_type=ap_outbox&p=8331&activitypub

obenland avatar Mar 27 '25 16:03 obenland

is this a public Announce? or (as with in the spec) it does not have an audience? I ask because otherwise Mastodon might show the Announce as a boost!?!

I wonder if they differentiate between announcing a Note (boost) and announcing a Create activity. It doesn't look like my example ^ created a boost.

obenland avatar Mar 27 '25 16:03 obenland

I'm not quite sure how this works, but the approach in #1515 doesn't seem to be it.

So far I tried announcing comments from the blog user, from the post author, updating the post, with and without being subscribed to the blog user from Lemmy—I've not been able to get new comments to show up in lemmy.

Before continuing on this, we should better understand how Lemmy keeps track of these things and what kinds of actions it expects other instances to take.

This reply has the lemmy user in cc and references the lemmy comment url in inReplyTo and it doesn't show up. It shouldn't even need an Announce from the blog to propagate that comment.

obenland avatar Mar 28 '25 15:03 obenland

@Nutomic should be able to help explain how lemmy expects the announces from WP.

db0 avatar Mar 29 '25 10:03 db0

Can you show me the activity json you are sending to Lemmy?

Nutomic avatar Apr 01 '25 12:04 Nutomic

@Nutomic I think this would be a good example https://obietester.blog/?post_type=ap_outbox&p=8331&activitypub.

I'm just not sure how it would be sent to Lemmy? The Lemmy user commenting would have to follow the actor of the original article, is that always the case?

obenland avatar Apr 01 '25 13:04 obenland

@Nutomic this is only the create! the plugin would encapsulate that in an Announce and send it to all Followers.

@obenland have you tried it with my proposed changes? I would assume that it has to be sent by the Group User.

pfefferle avatar Apr 01 '25 13:04 pfefferle

@obenland One problem Im seeing is that Lemmy expects the community to be included in to or cc of both the Create and the Note. Here you can see an example. It looks like you can already federate posts to Lemmy, so for comments it should be exactly the same. Also check the error message returned by Lemmy for your inbox request.

Nutomic avatar Apr 01 '25 13:04 Nutomic

@Nutomic thanks a lot for the example, but doesn't we have to send an Announce in that case? Because the comment wasn't made by someone on the blog!?!

Or is the example only to show how the Create as Announce-Object has to look like?

pfefferle avatar Apr 01 '25 13:04 pfefferle

Right, if the group is hosted by Wordpress then you need to send Announce with Create as object. I just dont have a full example for that around.

Nutomic avatar Apr 01 '25 13:04 Nutomic

@Nutomic nice, that should be enough! thanks as always :)

pfefferle avatar Apr 01 '25 13:04 pfefferle

@Nutomic currently I receive an error on simple Accept Activities. Here is an example of an Follow-Accept:

{
    "@context": [
        "https://www.w3.org/ns/activitystreams"
    ],
    "id": "https://pfefferle.org/?post_type=ap_outbox\u0026p=3789",
    "type": "Accept",
    "tag": [],
    "to": [
        "https://lemmy.ml/u/pfefferle"
    ],
    "mediaType": "text/html",
    "object": {
        "id": "https://lemmy.ml/activities/follow/305d6898-2e3c-40d6-a9bb-29e75c92e4b0",
        "type": "Follow",
        "object": "https://pfefferle.org/@pfefferle.org",
        "actor": "https://lemmy.ml/u/pfefferle"
    },
    "actor": "https://pfefferle.org/?author=0"
}

The Response I get is:

[body] => {"error":"unknown","message":"duplicate key value violates unique constraint \"community_featured_url_key\""}
[response] => Array
(
	[code] => 400
	[message] => Bad Request
)

Anything I am doing wrong?

pfefferle avatar Apr 25 '25 12:04 pfefferle

The error indicates that there is more than one group with the same featured url. Looks like this is happening because the group id known to lemmy.ml is https://pfefferle.org/@pfefferle.org but now it is https://pfefferle.org/?author=0. Did you change that intentionally for some reason? Generally it is not possible to change the activitypub id of an existing actor or object.

Nutomic avatar Apr 28 '25 12:04 Nutomic

Thanks so much @Nutomic ! I experimented with Moving Accounts!

pfefferle avatar Apr 28 '25 15:04 pfefferle

@Nutomic baby steps...

Now I see the following error:

[body] => {"error":"unknown","message":""}
[response] => Array
	(
		[code] => 400
		[message] => Bad Request
	)

when sending the following activity: https://pfefferle.org/?post_type=ap_outbox&p=3811&activitypub

pfefferle avatar May 06 '25 13:05 pfefferle

One thing I notice is that your activity id is not randomly generated. Is it possible that you sent multiple different activities with the same id? In that case Lemmy would ignore the duplicates.

However I cant find anything in the server logs. If the above doesnt help try sending a test activity to ds9.lemmy.ml which has more logging enabled and less noise from user activity.

Nutomic avatar May 07 '25 10:05 Nutomic

Some thoughts:

  1. As far as I understand, comment synchronization seems to rely on the group actor’s Announce activity. What happens if the group actor does not exist in a given implementation?

  2. What about comments whose visibility is not public — for example, those visible only to followers or mentioned users? Should such comments still be federated to unrelated servers, or should delivery be restricted only to the intended audience’s inboxes?

  3. In Misskey, all comments can be browsed regardless of context — isn’t this simply a design limitation of Lemmy? As far as I know, in the Fediverse, it’s actually normal behavior that not all comments are federated, depending on visibility or thread scope.

  4. For WordPress-to-WordPress comment synchronization, which model would be more appropriate — a push model, a pull model, or something similar to RSS polling?

  5. Personally, I find the current group actor model somewhat spammy. It doesn’t really improve feed readability, and often makes threads harder to follow.


As you know, I don’t think a blog profile is suitable as a group actor, since it isn’t a forum-type entity. Wouldn’t it make more sense to discuss federation with Lemmy after a proper forum profile is implemented in WordPress?

After all, Lemmy’s post type is based on Page, and since Page inherits the properties of a Document, it could potentially conflict with WordPress’s media library or related document structures.


By the way, has Lemmy’s WebFinger ambiguity issue been resolved? https://socialhub.activitypub.rocks/t/are-actors-and-webfingers-1-to-1/4539

Lemmy is a good example here, as users and communities may in fact use the same name, and the WebFinger is therefore ambiguous as to whether you meant the user or the community.

Wouldn’t a conflict occur in WordPress if the blog profile handle and the user profile handle are identical?

Jiwoon-Kim avatar Oct 24 '25 07:10 Jiwoon-Kim

I have a simple proposal to improve the Group Actor model:

  1. If a Group Actor is treated entirely as a forum, then even when an object's visibility is public, make it so that a Person Actor sends a Create activity targeting only that specific Group Actor. The Group Actor can then announce the post via an Announce activity. This ensures that if other users do not follow the forum, the object will generally not appear in their feeds.

  2. Prevent Group Actors from announcing comments. This clutters the feed unnecessarily. Federated comments should be synchronized differently — for example, through the context of the top-level post.


https://mastodon.social/@[email protected]/114553807766726642

I just learned that Lemmy actually does send activities where the addressing does not match:

Jiwoon-Kim avatar Oct 24 '25 10:10 Jiwoon-Kim

As far as I understand, comment synchronization seems to rely on the group actor’s Announce activity. What happens if the group actor does not exist in a given implementation?

I believe that wordpress-activitypub has a setting to use a group actor for federating posts. Thats what the dbzer0.com blog mentioned in the original post is using to federate with Lemmy. Otherwise I cant speak for the way wordpress-activitypub works.

By the way, has Lemmy’s WebFinger ambiguity issue been resolved? https://socialhub.activitypub.rocks/t/are-actors-and-webfingers-1-to-1/4539

Lemmy handles this with a property "https://www.w3.org/ns/activitystreams#type": "Person" (or Group) which allows to distinguish them. You can see it here: https://lemmy.ml/.well-known/webfinger?resource=acct:[email protected]

Prevent Group Actors from announcing comments. This clutters the feed unnecessarily.

Such a change is not possible at this point because FEP-1b12 is already widely used by different projects. It needs to be changed in Mastodon etc to not display Announce<Note> items from Group in the main feed. This should be easy to implement but it seems that Mastodon developers are not interested in it.

Nutomic avatar Oct 24 '25 13:10 Nutomic

I believe that wordpress-activitypub has a setting to use a group actor for federating posts. Thats what the dbzer0.com blog mentioned in the original post is using to federate with Lemmy. Otherwise I cant speak for the way wordpress-activitypub works.

Yes, when both the blog profile and user profile are enabled at the same time, the blog profile (?author=0) functions as a Group actor. However, I personally don’t think this is the right approach, since a blog is more like a news or magazine platform — not a forum.

That’s because, when implementing multi-forum functionality in WordPress, I want to make it possible to selectively expose Create activities and objects only within specific forums, and also display on the user profile which forum each object belongs to.

Personally, I feel that adopting FEP-1b12 was somewhat unfortunate, since it has now become entirely feasible to handle things through backfilling via conversation containers, or by using the context and reply properties instead.

Of course, it could also be due to an experiential mismatch caused by the fact that the expected behavior of the blog profile doesn’t really align with how a Group actor is supposed to function.

Still, the fact remains that comment synchronization via Announce — especially in the case of personal blogs — can generate a significant and unnecessary amount of traffic load.

Jiwoon-Kim avatar Oct 24 '25 13:10 Jiwoon-Kim