What is the maximum length of a comment?

When posting a large comment (over 32kb) I’m often provided with the following error dialog:

Screenshot from 2020-10-09 11-24-51

The comment is usually lost, although I’m not 100% certain it is always the case.

Posting a comment of similar size with the REST API results in a 500 Internal Server Error response.

It appears to me there’s a limit for the comment text size. What is it? Wouldn’t it be better to return a 400 Bad Request informing that the comment is too long?

I would be better not to have the app crash :roll_eyes:

Sure, this is why I’m asking. What is the limit? I would like to avoid posting comments that are too long.

After a few trial and error attempts it seems like comments below 32kb are safe to post. I wished the limitation was documented.

@Ross_Grambo is there a hard limit you can share with us?

1 Like

It looks like the limitation isn’t documented because it’s not straightforward. The limit is 65535 bytes, but that’s after we modify your input (like add anchor tags, metadata, etc.). We can’t document the limit because it depends what you send. If you send raw text vs sending a lot of rich text and links, you’ll see a big difference in the allowed length of your string.

2 Likes