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

Page機能の文字数上限の緩和をしてほしい #10574

Closed
tar-bin opened this issue Apr 10, 2023 · 5 comments
Closed

Page機能の文字数上限の緩和をしてほしい #10574

tar-bin opened this issue Apr 10, 2023 · 5 comments
Labels
✨Feature This adds/improves/enhances a feature

Comments

@tar-bin
Copy link
Contributor

tar-bin commented Apr 10, 2023

機能要望

Page機能の文字数上限の緩和をしてほしい

なぜ必要か

小説・字書き向けのMisskeyサーバーであるノベルスキーを運用しています。
ページ機能に小説を転載されるユーザーが多いのですが、Pageの文字数上限に引っかかって投稿できないという話を高頻度で受けています。

現在の状態

調査したところ、ページのセクションなしでシングルバイト文字で3万字、日本語等のマルチバイト文字で1万字程度しか投稿できないことがわかりました。それを超過すると、サーバーから Failed to load resource: the server responded with a status of 413 () が返され保存できません。(エラーダイアログもでず無反応になります)

{"statusCode":413,"code":"FST_ERR_CTP_BODY_TOO_LARGE","error":"Payload Too Large","message":"Request body is too large"}

原因としてはEndpoint API用のFastifyのbodyLimitとして一律で { bodyLimit: 1024 * 32 } が設定されているためです。
https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/ApiServerService.ts#L92

ページに関してはcontentはDBにjsonbで保存されるためパフォーマンスを考えなければ最大1GB程度までは保存できるはずです。
https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/models/entities/Page.ts#L81
もちろん1GBはやりすぎですが、日本語で1万文字は文字量として少ないと考えられます。json形式ですのでセクションで分けた場合はもっと最大文字数が減ることになります。

希望する状態

  • 少なくともページ用APIに関してbodyLimitをセクションなしでマルチバイト文字10万文字程度まで緩和いただきたい(現在の10倍)
  • 可能であれば最大文字数を超過した場合はエラーダイアログを表示していただきたい
@tar-bin tar-bin added the ✨Feature This adds/improves/enhances a feature label Apr 10, 2023
@syuilo syuilo closed this as completed in 59ca0d2 Apr 11, 2023
@syuilo
Copy link
Member

syuilo commented Apr 11, 2023

32倍にしてみました

@acid-chicken
Copy link
Member

59ca0d2

で 4 万字になったけど、まだ足りる時と足りない時がありそうだしいっそのこと 1MB (約 35 万文字) とかでもいい気がする

@acid-chicken
Copy link
Member

acid-chicken commented Apr 11, 2023

と思ったら行き違いだった @ 43eee54

@syuilo
Copy link
Member

syuilo commented Apr 11, 2023

Pages以外でも管理者用絵文字管理APIあたりで一度に大量に操作する場合1MBくらい行く可能性もありそうだなと思ったから1MBにした

@tar-bin
Copy link
Contributor Author

tar-bin commented Apr 11, 2023

ありがとうございます!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨Feature This adds/improves/enhances a feature
Projects
None yet
Development

No branches or pull requests

3 participants