-
Notifications
You must be signed in to change notification settings - Fork 98
Description
I'd like to discuss some message size limits we should implement in twister-html.
Background:
- as explained here raise char limit to 256 twister-core#76 (comment) there are some limits on bencoded post size (counting text octets, possibly more than utf8 chars for non-latin langs, and extra fields overhead).
- as of today, with this commit miguelfreitas/twister-core@54b1d9e the 140 characters limit was mostly removed from twister-core. however posting arbitrary long posts will cause then to be rejected by the network as pointed by @dryabov here miguelfreitas/twister-core@54b1d9e#commitcomment-16853339
- @dryabov is correct in pointing that it is much easier counting utf8 characters in frontends (twister-html) than octets of the bencoded post.
so i'd favor some reasonably agreed limits like the suggested here miguelfreitas/twister-core#76. The 256 chars limit was endorsed by @gubatron @kseistrup @abiliojr @Qqwy @lohang and @jpfox (iirc @blog2read voted for 1024)
So my current suggestion (for discussion!) is:
-
Implement an user-defined limit on twister-html on maximum characters that should be shown on received twists. My vote is that this value should be 256 by default. So we'd have a "soft" limit we may easily change in future without protocol breakage.
-
Should we display the remaining characters of the post when user clicks to expand it? Or just clip it for displaying both collapsed and expanded? That's also a good point for discussion.
-
Implement warnings on text editing to report when 140 characters are reached ("older twister clients won't show this post entirely") and 256 characters ("this post is too long, it may be refused by some nodes and not appear on mentions")
-
The nice post preview added by @slr could use different colors for the first 140 characters, like twitter does.
-
The DM never really had a 140 characters limit. We have a 2048 byte limit for the encrypted total size, so it's hard to know exactly what the real limit is. Maybe increasing it to 256 or 512 should be fine (some sites claim chinese uses, on average, 3 bytes per utf8 char).