Mastodon/Activity Pub question:
-
@sarahjamielewis Maaaaaybe it has something to do with the content type? It looks like you serve the HTML if explicitly asked for text/html, and the JSON otherwise. I usually do it the other way around.
I think Mastodon refuses to load plain JSON documents, for security reasons (long story), this might be linked to that. Only sending the AP JSON for the content types listed in section 3.2 of the spec could be worth trying.
I'm poking at this kinda blindly though. Tough situation to debug.
@sarahjamielewis For what it's worth, @fedify fetches and parses your actor correctly (tested with https://github.com/fedify-dev/fedify/tree/main/examples/actor-lookup-cli), so it's gotta be something where Mastodon is more strict.
-
My current working theories in no particular order:
- I've missed something about how create activities/notes are constructed which conveys some kind of explicit/implicit content type?
- does mastodon do some form of tiered server trusting when it comes to deciding what to format?
- a text encoding issue somewhere?
What we have learned so far:
- taking the json my service produces and mirroring on another AP service results in mastodon rendering the HTML on the mirrored post - so it unlikely to be an issue with the Note object at least...
- just in case, I've tweaked a couple of things in webfinger, nodeinfo, and http header signing to better align the behaviour that mastodon is has, to no effect.
-
What we have learned so far:
- taking the json my service produces and mirroring on another AP service results in mastodon rendering the HTML on the mirrored post - so it unlikely to be an issue with the Note object at least...
- just in case, I've tweaked a couple of things in webfinger, nodeinfo, and http header signing to better align the behaviour that mastodon is has, to no effect.
I have officially ran out of ideas...probably time to take a break....
Request: If anyone who knows anything about mastodon internals has any idea why plain text messages would show fine, but basic html formatted messages would show empty (see above) - I would greatly appreciate any insight.
Edit: Thanks all, This has been Solved! (https://mastodon.social/@sarah@tap.resistant.tech/114644828209750037)
-
I have officially ran out of ideas...probably time to take a break....
Request: If anyone who knows anything about mastodon internals has any idea why plain text messages would show fine, but basic html formatted messages would show empty (see above) - I would greatly appreciate any insight.
Edit: Thanks all, This has been Solved! (https://mastodon.social/@sarah@tap.resistant.tech/114644828209750037)
@sarahjamielewis can you share a sample json you're sending?
-
I have officially ran out of ideas...probably time to take a break....
Request: If anyone who knows anything about mastodon internals has any idea why plain text messages would show fine, but basic html formatted messages would show empty (see above) - I would greatly appreciate any insight.
Edit: Thanks all, This has been Solved! (https://mastodon.social/@sarah@tap.resistant.tech/114644828209750037)
@sarahjamielewis Hey @evan any ideas?
-
@sarahjamielewis can you share a sample json you're sending?
The note: https://tap.resistant.tech/sarah/posts/1749337528.json (doesn't include the wrapping Create activity, but sending plain text messages work, so I assume the Create activity is OK...I can pull one from the debug logs)
The empty render: https://mastodon.social/@sarah@tap.resistant.tech/114644584327450993
-
@sarahjamielewis Hey @evan any ideas?
@soatok @sarahjamielewis they've got a list of tags they allow. Could you be using something at the top level that they sanitize out?
ActivityPub - Mastodon documentation
A decentralized social networking protocol based upon the ActivityStreams 2.0 data format and JSON-LD.
(docs.joinmastodon.org)
-
@soatok @sarahjamielewis they've got a list of tags they allow. Could you be using something at the top level that they sanitize out?
ActivityPub - Mastodon documentation
A decentralized social networking protocol based upon the ActivityStreams 2.0 data format and JSON-LD.
(docs.joinmastodon.org)
@soatok @sarahjamielewis also, very excited to see your service!
-
The note: https://tap.resistant.tech/sarah/posts/1749337528.json (doesn't include the wrapping Create activity, but sending plain text messages work, so I assume the Create activity is OK...I can pull one from the debug logs)
The empty render: https://mastodon.social/@sarah@tap.resistant.tech/114644584327450993
@sarahjamielewis Nothing is obviously wrong with it. This is just a guess, but it might be the capitalization on the unicode escapes? Mastodon capitalizes them. Here's a mastodon note that I keep around for regression testing
https://github.com/Letterbook/Letterbook/blob/main/Tests/Letterbook.IntegrationTests/Data/mastodon_post.json -
@sarahjamielewis Nothing is obviously wrong with it. This is just a guess, but it might be the capitalization on the unicode escapes? Mastodon capitalizes them. Here's a mastodon note that I keep around for regression testing
https://github.com/Letterbook/Letterbook/blob/main/Tests/Letterbook.IntegrationTests/Data/mastodon_post.json@sarahjamielewis I put this together to help with interop testing. It's really useful to have access to mastodon's logs while you're trying to do this stuff
https://github.com/Letterbook/Sandcastles -
@sarahjamielewis Nothing is obviously wrong with it. This is just a guess, but it might be the capitalization on the unicode escapes? Mastodon capitalizes them. Here's a mastodon note that I keep around for regression testing
https://github.com/Letterbook/Letterbook/blob/main/Tests/Letterbook.IntegrationTests/Data/mastodon_post.jsonjenniferplusplus@hachyderm.io I think it might be the Unicode escapes too. I don't think they're necessary.