Почему якобы федеративные через ActivityPub темы Discourse недоступны из внешних AP-клиентов?

Пример

Если я введу https://meta.discourse.org/t/uris-to-the-origin-of-a-thread-that-has-since-been-merged-should-503-to-the-merged-comment/342417?u=rokejulianlockhart (или https://meta.discourse.org/ap/object/bc8f042ccca5ef56734c5f2460aa45cc) [1] в mastodon.social/search, то получаю ошибку 404: [2] [3]

Если это не проблема Discourse, я обращусь с этим в Mastodon. Однако большинство других платформ AP, которые я пробовал (и от которых ожидал, что они будут работать), работают корректно.


  1. https://meta.discourse.org/t/uris-to-the-origin-of-a-thread-that-has-since-been-merged-should-503-to-the-merged-comment/342417?u=rokejulianlockhart ↩︎

  2. search?q=https%3A%2F%2Fmeta.discourse.org%2Fap%2Fobject%2Fbc8f042ccca5ef56734c5f2460aa45cc ↩︎

  3. search?q=https%3A%2F%2Fmeta.discourse.org%2Ft%2Furis-to-the-origin-of-a-thread-that-has-since-been-merged-should-503-to-the-merged-comment%2F342417%3Fu%3Drokejulianlockhart ↩︎

1 лайк

I’m missing this as well. Without this, it is hard or impossible to interact with federated posts unless they are in your timeline already.

@rokejulianlockhart, just curious, have you tried with URLs of WordPress instances using the WP ActivityPub plugin?

1 лайк

What the heck has occurred here? I have never written like the undermentioned:

RokeJulianLockhart:

Discuss this on our forum.

...and someone's taken a sledgehammer to my markup.

1 лайк

Oh! They’re federated now! I didn’t post that comment here. [1] They’re merely rather broken in their federation:

  1. The formatting isn’t conserved.

  2. I am able to like my own posts.

    It’s a separate user account, since it’s registered on another domain.

@icaria36, no. Do you know of any?


  1. socialhub.activitypub.rocks/t/5123/3 ↩︎

I believe this is a WordPress site, and I just tested with a recent article, and I can find the URL on Mastodon indeed: Nature Holds Awe, Man – NHAM Mixtape 11 – NHAM

@icaria36, I don’t think so. Discourse has native AP integration.

@rokejulianlockhart To your point when you created this topic, meanwhile, https://meta.discourse.org/t/why-are-supposedly-activitypub-federated-discourse-threads-inaccessible-via-external-ap-clients/356997 cannot be found on Mastodon.

1 лайк

@icaria36, it’s probably a fault of Mastodon’s, then, since Discourse federates it:

1 лайк

github.com/mastodon/mastodon/discussions/34600#discussioncomment-13031935 states:

The Discourse AP plugin makes ActivityPub objects available when you click the green ActivityPub logo and click the “Note” button to copy the URL: Why are supposedly ActivityPub-federated Discourse threads inaccessible via external AP clients? - #9 by rokejulianlockhart - Bug - Discourse Meta

Discourse AP needs to make the url link back to the id in some way, preferably via a redirect on requests with the correct Accept content negotiation header.

Consequently, I’ll tentatively set this as a Bug. (I can’t. Too old.)

But the URLs provided by the “Notes” icon don’t throw any results when pasted on i.e. mastodon.social/search.

Problem not solved.

1 лайк

@icaria36, please comment that on the GitHub Discussion. Having someone else challenge the response lends some more credibility than having me be the liason.

1 лайк

Looks like that:

1 лайк

Well, no, it seems that it might be a Discourse bug after all: Posts from Discourse do not resolve via the Search API · Issue #34632 · mastodon/mastodon · GitHub

Investigating a bit more, Mastodon requests the resource with the following Accept header:

Accept: application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams", text/html;q=0.1

Querying discourse with this results in the HTTP 400 response.

Omitting the text/html;q=0.1 returns an ActivityStreams object. So this seems to be a bug with Discourse, which seems to return a 400 anytime text/html is part of the accepted types…

1 лайк

@rokejulianlockhart или модератор, пожалуйста, удалите «Решение» и переместите эту тему в bug (или создайте новый отчёт об ошибке) на основе оценки Mastodon: Posts from Discourse do not resolve via the Search API · Issue #34632 · mastodon/mastodon · GitHub.

2 лайка

Я не уверен, что это ошибка в Discourse. Я ответил на эту проблему в Mastodon. Дублирую здесь для удобства:

Мы возвращаем 400 в этом сценарии, потому что спецификация ActivityPub кажется, требует этого.

POST-запросы (например, в почтовый ящик) ДОЛЖНЫ выполняться с Content-Type: application/ld+json; profile=“ActivityStreams 2.0 Terms”, а GET-запросы (см. также 3.2 Получение объектов) — с заголовком Accept: application/ld+json; profile=“ActivityStreams 2.0 Terms

@ClearlyClaire Нужно ли добавлять text/html;q=0.1 в заголовок Accept?

2 лайка

Это будет решено в ближайшее время. Подробнее:

3 лайка