snarfed / bridgy

📣 Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...
https://brid.gy
Creative Commons Zero v1.0 Universal
702 stars 51 forks source link

Bluesky truncation #1666

Closed miklb closed 4 months ago

miklb commented 4 months ago

Posted a note today that didn't syndicate to Bluesky

brid.gy log

Invalid [app.bsky.feed.post](http://app.bsky.feed.post/) record: Record/text must not be longer than 300 graphemes"}

I'm currently using <data class="p-bridgy-omit-link" value="maybe" /> as I was debugging sending webmentions and wanted to eliminate the URL param as the culprit.

Originally posted by @miklb in https://github.com/snarfed/bridgy/issues/1580#issuecomment-1939180282

snarfed commented 4 months ago

Thanks for filing! Here's the text bridgy tried to post:

Reading a blog post from a designer I really admire and went to take a look at their markup. Holy divitis Batman! Straight up tailwind soup. No `<main>`. No `<article>` just `<divs>` and `<p>` all the way down. It’s really hard to want to care about this stuff when people… https://michaelbishop.me/note/1707754476f.html

Looks like we're treating URLs as fixed length in Bluesky, when they're actually not.

miklb commented 4 months ago

that's not convenient.

snarfed commented 4 months ago

cc @JoelOtter, this and #1665 should be pretty straightforward if you're interested in jumping back in here at all!

JoelOtter commented 4 months ago

Happy to take this - is this dependent on the linkification work or do we already turn these particular links into facets?

snarfed commented 4 months ago

I think they're independent. My guess is that we default to assuming that text URLs only cost a fixed 23 chars, probably in a constant in Source, and we need to override that.

snarfed commented 4 months ago

I looked at this a bit, and my hunch ^ wasn't right.

I'm not sure exactly what happened originally here, but I've made some changes to this code, and I suspect it may be fixed. I posted https://bsky.app/profile/snarfed.bsky.social/post/3klxj6ulons2o which was truncated and used "omit link: maybe", and it worked ok. @miklb want to try again?

miklb commented 4 months ago

@snarfed success. thank you.