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

Bidirectional comments don't reply to the original comment

Open edent opened this issue 1 year ago • 26 comments

Quick summary

When I reply to a comment on my blog, it posts a new ActivityPub message - but it isn't in reply to the original comment.

Steps to reproduce

  1. Post on https://shkspr.mobi/blog/2020/03/it-is-spelled-url/
  2. This person replies https://post.lurk.org/@rose_alibi/111722787436930132
  3. I reply to their comment https://shkspr.mobi/blog/2020/03/it-is-spelled-url/#comment-363977
  4. The reply is sent without any context https://mastodon.social/deck/@[email protected]/111725492490736277

image

What you expected to happen

My comment should be in reply to the original comment. Or in reply to the original post.

What actually happened

The comment has no context, so looks a bit weird. Additionally, there's no setting to suppress comments from appearing.

Impact

One

Available workarounds?

No but the platform is still usable

Logs or notes

No response

edent avatar Jan 09 '24 10:01 edent

Ah! If I reply to someone who replied to my blog, it does thread properly.

Screenshot showing a threaded reply https://shkspr.mobi/blog/2023/12/the-joy-and-the-pity-of-making-your-own-stuff/#comment-363984

But, because it doesn't @ them, do they get notified?

This is excellent functionality! But I think it needs an option to be disabled when replying to regular comments. Otherwise there will be some very weird out of context posts.

edent avatar Jan 09 '24 10:01 edent

But, because it doesn't @ them, do they get notified?

This is a known problem and I am experimenting on how to implement it nicely (I would love to have it without the @-reply thing at the beginning).

Otherwise there will be some very weird out of context posts.

Good point!

pfefferle avatar Jan 09 '24 11:01 pfefferle

Post on https://shkspr.mobi/blog/2020/03/it-is-spelled-url/ This person replies https://post.lurk.org/@rose_alibi/111722787436930132 I reply to their comment https://shkspr.mobi/blog/2020/03/it-is-spelled-url/#comment-363977

I think what might have happened here is their original reply was not to your blog actor, but to a crossposted/syndicated copy under your actual Mastodon account? And that Brid.gy backfed it to your blog.

Update: note even that, I think you just linked to it from a "toot." Brid.gy is like that, it'll attempt to send a webmention (?) even for replies to mere ... mentions.

Anybody replying to any other "toot" mentioning a URL of yours will trigger this behavior (in my experience). It can be confusing.

It also appears that all author/user comments make it back "to the Fediverse," even those (like in your example) that did not come (directly) from a "ActvitiyPub actor."

Ah! If I reply to someone who replied to my blog, it does thread properly.

Exactly, that's been my experience, too.

janboddez avatar Jan 10 '24 13:01 janboddez

Either way, it looks like the "real" issue (bug?) is that all of an author's comments get sent out "to the fediverse," even those not in reply to "fediverse comments."

That said, the plugin does seem to set a "inReplyTo" property: https://github.com/Automattic/wordpress-activitypub/blob/48a33b82e929725cdcd358c4b87fc188ec25764a/includes/transformer/class-comment.php#L136

Guessing Mastodon just doesn't know what to do with it?

Because I do think that in this specific case, had the inReplyTo been set to the comment's fediverse URL (which I think would be stored in webmention_source_url, given that the comment originated as a Bridgy (?) mention), that your reply would've been threaded "OK." This could be done using custom code. (Like, it's not straightforward, but I'm 100% sure it can be done.)

But the latter may not be a solution for other, "random" comments. I kinda also wanna be able to stop "irrelevant" (?) comments from being federated.

janboddez avatar Jan 10 '24 14:01 janboddez

I'm wondering if there is a larger issue here. Last month I was noticing that replies made before the latest update were often not connecting to the original post, but the behavior was inconsistent.

mikewmerritt avatar Jan 10 '24 22:01 mikewmerritt

I think this is an issue from the plugin not handling old comments properly, I am working on a fix!

pfefferle avatar Jan 11 '24 08:01 pfefferle

I'm wondering if there is a larger issue here. Last month I was noticing that replies made before the latest update were often not connecting to the original post, but the behavior was inconsistent.

I'm seeing the same, second-level comments on my blog are assigned to the Home Page, not the post they were originally commented on.

Screenshot 2024-04-17 at 11 58 00

KevinGimbel avatar Apr 17 '24 09:04 KevinGimbel

@KevinGimbel I can't see any issues on your screenshot. It shows the replies and it also lists the post properly. Do I muss something?

Screenshot 2024-04-17 at 12 43 42

pfefferle avatar Apr 17 '24 10:04 pfefferle

Sorry, yes it's confusing.

In my screenshot the "In response to" is wrong - the top two comments are commenting on the Home Page of my blog, the other two are replies to the "Week 19: Fallout" post (as seen in your screenshot)

KevinGimbel avatar Apr 17 '24 10:04 KevinGimbel

I would expect all comments to be nested under this post: https://kevingimbel.de/blog/2024/04/week-19-fallout#comments

KevinGimbel avatar Apr 17 '24 10:04 KevinGimbel

This might be because it is simply an @-mention and not a reply to a post, which is currently not really supported. This might be a feature (not a bug ☺️) if you use a single page as home page.

pfefferle avatar Apr 17 '24 10:04 pfefferle

Hmm I do use a single page as home page :D Should I open a feature request then? In terms of having - and preserving - conversations in the comment section it'd be good to have them properly nested

KevinGimbel avatar Apr 17 '24 10:04 KevinGimbel

Ah, now I see! No, you are completely right, this is a bug!

pfefferle avatar Apr 17 '24 10:04 pfefferle

Ah, it's because the comment id used by the ActivityPub plugin https://kevingimbel.de/?c=682 is pointing to your home-page instead of to the comment!

## Request
curl "https://kevingimbel.de/?c=682" \
     -H 'Accept: application/activity+json'

Do you have caching enabled?

pfefferle avatar Apr 17 '24 10:04 pfefferle

This is how it should behave: https://notiz.blog/?c=1900601

and

## Request
curl "https://notiz.blog/?c=1900601" \
     -H 'Accept: application/activity+json'

pfefferle avatar Apr 17 '24 10:04 pfefferle

Yes I use the WP Super Cache Plugin, I'll check if there's anything in the settings

KevinGimbel avatar Apr 17 '24 10:04 KevinGimbel

Seems to work now - there was an option to not cache pages with GET parameters and now the link leads me to the comment.

KevinGimbel avatar Apr 17 '24 10:04 KevinGimbel

I was too excited, the curl still doesn't work it seems 🤔

KevinGimbel avatar Apr 17 '24 10:04 KevinGimbel

What plugin do you use for caching? Can you add an exception for different Accept headers (content negotiation)?

pfefferle avatar Apr 17 '24 11:04 pfefferle

I'm using https://wordpress.org/plugins/wp-super-cache/ - I'll see if I can add exceptions

KevinGimbel avatar Apr 17 '24 11:04 KevinGimbel

@donnchawp can you maybe support here?

pfefferle avatar Apr 17 '24 11:04 pfefferle

I was not able to replicate this issue on my own site. I responded to a comment and it was seen as a reply on the first comment in the Mastodon web client. The page was cached by WP Super Cache when I commented as a logged-in user on my site.

Screenshot 2024-04-22 at 16 29 14

I noticed that @edent is using Litespeed cache which might have caused the problem. I'm not sure if it uses the Accept header in the cache key.

donnchawp avatar Apr 22 '24 15:04 donnchawp

I just tried again and it doesn't work for me.

The top comment is assigned to the home-page again (coming from a reply on Mastodon).

Screenshot 2024-04-23 at 11 42 09

KevinGimbel avatar Apr 23 '24 09:04 KevinGimbel

Same with WP Super Cache disabled - the third comment is always in reply to the home-page.

Screenshot 2024-04-23 at 11 45 37

KevinGimbel avatar Apr 23 '24 09:04 KevinGimbel

The threading on Mastodon is correct, see https://fosstodon.org/@[email protected]/112319876177431843 and https://fosstodon.org/@[email protected]/112319888185816280

KevinGimbel avatar Apr 23 '24 09:04 KevinGimbel

The issue still persists, it just happened again. The top-most comment is a reply to the home page not the post.

Screenshot 2024-08-05 at 10 32 31

Post: https://kevingimbel.de/blog/2024/08/re-leaked-github-python-token/

Screenshot from Mastodon: Screenshot 2024-08-05 at 10 36 35

KevinGimbel avatar Aug 05 '24 08:08 KevinGimbel