Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase character limit for markdown fields. #3262

Closed
dessalines opened this issue Nov 11, 2022 · 13 comments
Closed

Increase character limit for markdown fields. #3262

dessalines opened this issue Nov 11, 2022 · 13 comments
Labels
enhancement New feature or request

Comments

@dessalines
Copy link
Member

dessalines commented Nov 11, 2022

Context: #2546

50k characters seems a reasonable increase from the current 10k.

@thayerw
Copy link

thayerw commented Jun 12, 2023

Not sure if this is a regression, but I seem to be hitting an invisible char limit in post body fields.

In the absence of a wiki feature, I'm trying to create a large post (user guide) with approximately 22K characters. Upon submission, the Create button simply spins indefinitely. Can submit much shorter posts without issue. I see that others are having a similar issue with a 7K+ char post.

@Nutomic
Copy link
Member

Nutomic commented Jun 12, 2023

The backend has a max length of 10k characters.

https://github.com/LemmyNet/lemmy/blob/main/crates/utils/src/utils/validation.rs#L20

@Nutomic Nutomic reopened this Jun 12, 2023
@exu-g
Copy link

exu-g commented Jun 14, 2023

Would it make sense to reopen #2546 instead of this issue here?

@TheLongLife
Copy link

It took me a while to figure out why I couldn't submit the post. A warning for when we hit the character limit would be nice, at least.

@smorks
Copy link
Contributor

smorks commented Jun 21, 2023

The backend has a max length of 10k characters.

https://github.com/LemmyNet/lemmy/blob/main/crates/utils/src/utils/validation.rs#L20

i'm not sure if that's what's happening here, since that validation was only added recently (38d4429) and only appears to be in v0.18.0.

but i've also definitely run into this issue with 0.17.4.

@Sudneo
Copy link

Sudneo commented Jun 21, 2023

I confirm that I am also hitting this error. The server is running 0.17.4 and the post I am trying to submit has about 21k characters.

From the browser I see the websocket request to POST data, but no answer at all. From Jerboa I get an "invalid_body_field" error, which made me thing about the size of the text, and matches https://github.com/LemmyNet/lemmy/blame/37754189524e761626917295958cc156b1d21481/crates/utils/src/utils/validation.rs#L75

@thayerw
Copy link

thayerw commented Jun 21, 2023

Sincerely hoping we see this bumped to at least 50K chars soon. It's holding back more than a few former subreddits from getting their wikis running on lemmy.

@alectrocute
Copy link

@dessalines Is this a backend-related task?

@Nutomic Nutomic transferred this issue from LemmyNet/lemmy-ui Jun 22, 2023
@Nutomic
Copy link
Member

Nutomic commented Jun 22, 2023

Changing this line works in my tests to increase the limit to 50k chars. However the same limit also applies to comments, which seems too much. So there should be a separate, lower limit added for comments imo.

@Neriderc
Copy link

For anyone arriving here wondering why they can only post 10k characters - well I don't have an answer for you, but know that if you post it first, then you can edit it and it allows the 50k in the edit.

@foresto
Copy link

foresto commented Jan 17, 2024

if you post it first, then you can edit it and it allows the 50k in the edit.

This doesn't work for me on Lemmy 0.19.2. Editing a comment field (in the web UI) to add more text also triggers the cryptic invalid_body_field error. I assume the error comes from the back end.

@Neriderc
Copy link

This doesn't work for me on Lemmy 0.19.2. Editing a comment field (in the web UI) to add more text also triggers the cryptic invalid_body_field error. I assume the error comes from the back end.

Not surprising, because of significant backend changes, but good to know.

@dessalines
Copy link
Member Author

I checked the logic on the back end, and it looks okay:

pub fn is_valid_body_field(body: &Option<String>, post: bool) -> LemmyResult<()> {

Lemmy-ui might also need to be updated for this limit tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants