snarfed / granary

💬 The social web translator
https://granary.io
Creative Commons Zero v1.0 Universal
447 stars 57 forks source link

Bluesky: truncate string values to length limits #717

Closed snarfed closed 6 months ago

snarfed commented 7 months ago

Lexicons can include length limits for some fields, eg 300 graphemes for app.bsky.feed.post text. The relay (or AppView?) checks length limits in record validation and drops records if any fields are over their limit. We need to handle this in bluesky.to/from_as1.

Ideally we'd bundle the lexicons themselves and look up and use per-field length limits automatically. Not sure I want to go that far though. Alternatively we could do this in lexrpc, with an option to truncate values that are too long.

snarfed commented 6 months ago

granary already has lexrpc as a dependency! So I did this in both places.