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

Federation to lemmy stopped

Open db0 opened this issue 2 weeks ago • 2 comments

Quick summary

I just posted this article: https://dbzer0.com/blog/an-epic-3d-printed-fan-expansion-for-last-light/ and I expected it to federate to my lemmy instance. It federated towards mastodon, but not towards lemmy. Last time I posted this worked, and I haven't touched my blog since, so I'm suspecting a recent update broke something?

Steps to reproduce

  • Post on Wordpress
  • Don't see it on lemmy.

Site owner impact

More than 60% of the total website/platform users

Severity

Moderate

What other impact(s) does this issue have?

No revenue impact

If a workaround is available, please outline it here.

  • I wanted to see any federation logs to understand if there's something going wrong, but I don't know where the logs are.

db0 avatar Dec 10 '25 18:12 db0

I think this is a problem of that specific post, not a general issue. I was able to import one of your two year old posts into lemmy without any isses.

I sadly have no test instance, maybe @Nutomic could run a short check why this URL fails?

pfefferle avatar Dec 11 '25 08:12 pfefferle

I was suspecting that. Maybe a char in the stub causes an error? It's very strange.

db0 avatar Dec 11 '25 08:12 db0

Had a look and the post is working fine on various instances:

  • https://lemmy.dbzer0.com/post/59512492
  • https://lemmy.world/post/40134461
  • https://lemmy.ml/post/40264502

Did you change anything to make it work, and if so what was it?

Nutomic avatar Dec 15 '25 09:12 Nutomic

@Nutomic these examples are is not a federated post. These are manual post I did myself, as one does with any other website. An actual federated post looks like this: https://lemmy.dbzer0.com/post/58061475

db0 avatar Dec 15 '25 12:12 db0

Ah my bad I didnt check it properly. The error message in Lemmy logs is Response body limit was reached during fetch, because fetches are limited to 200kb and your post has 300kb (curl -H 'Accept: application/activity+json' https://dbzer0.com/blog/an-epic-3d-printed-fan-expansion-for-last-light/ -w '%{size_download}' -so /dev/null). The limit is increased to 1mb for Lemmy 1.0, so it will work then.

Looking at the HTML sent by Wordpress over Activitypub, there are a lot of attributes which are not used by Lemmy and probably neither by other platforms. It would be worth considering to strip out some of them, such as class (especially wordpress-specific classes), loading="lazy" decoding="async" data-id="28023" etc.

Part of the data for illustration:

<div class=\"wp-block-group\">
   <div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">
      <h2 class=\"wp-block-heading\">Purple</h2>
      <div class=\"wp-block-group\">
         <div class=\"wp-block-group__inner-containeris-layout-constrained wp-block-group-is-layout-constrained\">
            <figure class=\"wp-block-image size-full\">
               <img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"980\" height=\"980\" src=\"https://i0.wp.com/dbzer0.com/wp-content/uploads/2025/12/Splash-Art-6.png?resize=980%2C980&#038;ssl=1\" alt=\"\" class=\"wp-image-28022\" srcset=\"https://i0.wp.com/dbzer0.com/wp-content/uploads/2025/12/Splash-Art-6.png?w=1024&amp;ssl=1 1024w, https://i0.wp.com/dbzer0.com/wp-content/uploads/2025/12/Splash-Art-6.png?resize=300%2C300&amp;ssl=1 300w, https://i0.wp.com/dbzer0.com/wp-content/uploads/2025/12/Splash-Art-6.png?resize=150%2C150&amp;ssl=1 150w, https://i0.wp.com/dbzer0.com/wp-content/uploads/2025/12/Splash-Art-6.png?resize=768%2C768&amp;ssl=1 768w, https://i0.wp.com/dbzer0.com/wp-content/uploads/2025/12/Splash-Art-6.png?resize=210%2C210&amp;ssl=1 210w\" sizes=\"auto, (max-width: 980px) 100vw, 980px\" />
               <figcaption class=\"wp-element-caption\"><strong><a href=\"https://makerworld.com/en/models/2073151-last-light-spaceships-purple-theme\">Purple: Centrifugal</a></strong></figcaption>
            </figure>

The bloat is further increased by use of contentMap which duplicates the entire post content. I dont like that way of specifying the post language, it would make more sense to have a simple attribute language: en. Seems we have to blame Mastodon for this, like so often.

Nutomic avatar Dec 15 '25 13:12 Nutomic

Thanks @Nutomic ! I will see how I can reduce the Activity a bit. Thanks for the suggestions!

Does Lemmy support contentMap or is it always using the content only?

pfefferle avatar Dec 15 '25 14:12 pfefferle

Lemmy only uses content, and in fact it sets the language like this (Peertube also uses the same format):

"language": {
  "identifier": "en",
  "name": "English"
},

Nutomic avatar Dec 15 '25 21:12 Nutomic

Cleaning up the class and data-* attributes saves up to 50% 😱

I ran a test with the JSON file of @db0 . Here are the results:

Content Field

Metric Size
Original 128,029 bytes
Cleaned 35,678 bytes
Saved 92,351 bytes (72.1%)

Full JSON Payload

Metric Size
Original 316,257 bytes
Cleaned 172,192 bytes
Saved 144,065 bytes (45.6%)

thanks as always @Nutomic !

pfefferle avatar Dec 16 '25 11:12 pfefferle

Good job!

Nutomic avatar Dec 16 '25 11:12 Nutomic