deltachat-core icon indicating copy to clipboard operation
deltachat-core copied to clipboard

truncate messages saved in the database?

Open r10s opened this issue 5 years ago • 3 comments

afaik, currently, there is no limit in message lengths that is written to the database.

however, there is a limit of the number of characters that is returned in dc_msg_get_text() (currently max. 30kb)

while longer texts (say several mb) are no problem in general, they can cause problems eg. on the current fulltext search implementation which is basically a LIKE '%pattern%' query (yes, it can also be improved), but very long texts may cause any kind of other problems as well.

also, the typical controls are not capable of displaying long text.

so, i would suggest to not write very long texts to the database txt field. however, it can be written to the txt_raw field. another idea may be to convert these long text to an attachment, however, this may be a bit unexpected and also, typically, these long text are not really "user typed" text, it's more uuencoded stuff or pgp-armored-messages or so.

r10s avatar May 25 '19 12:05 r10s

I vote for truncate it, but then add a remark in text, like "=== message truncated ===" or so.

csb0730 avatar May 27 '19 23:05 csb0730

in fact, messages are already truncated now, eg. full quotes are truncated. truncated parts are marked by [...] then.

r10s avatar May 28 '19 07:05 r10s

If that's the marker: Ok

I didn't saw that marker it in that way. I more assumed that the rest of the message is somewhere available if I see "[...]"

Truncate means, no rest available.

I'm ok with that too ;-)

csb0730 avatar Jun 02 '19 23:06 csb0730