this post was submitted on 09 Jul 2023
5 points (100.0% liked)

Lemmy

12444 readers
8 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

founded 4 years ago
MODERATORS
 

I'm inclined to say it happens to comments that are too long but I'm not sure it's the only case where it happens. It seems the API simply returns a 400 error with "invalid_body_field" as the response. The web UI however just displays an infinite spinning wheel with no helpful error message.

top 2 comments
sorted by: hot top controversial new old
[–] WalterLatrans@yiffit.net 2 points 1 year ago* (last edited 1 year ago) (1 children)

I had a peek at the source code and although I don't actually know Rust it looks like that error comes from a check for character length in the function "is_valid_body_field". Strangely it does the same check twice against two variables "POST_BODY_MAX_LENGTH" and "BODY_MAX_LENGTH".

The smaller of the two is BODY_MAX_LENGTH which is set at 10000, so I assume the max character limit is 10,000. There are no other checks in that function other than the character count and that's the only place in the source code that the text "invalid_body_field" shows up so I assume it's only sent as a response to too much text, but as I said I don't actually know Rust so I could be wrong.

[–] AlmightySnoo@lemmy.world 2 points 1 year ago* (last edited 1 year ago)

I just checked validation.rs (line 132) too and you're right!

load more comments
view more: next ›