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

虚無ノートが投稿できる #12381

Closed
acid-chicken opened this issue Nov 19, 2023 · 2 comments · Fixed by #12969
Closed

虚無ノートが投稿できる #12381

acid-chicken opened this issue Nov 19, 2023 · 2 comments · Fixed by #12969
Labels
🐛Bug Unexpected behavior

Comments

@acid-chicken
Copy link
Member

acid-chicken commented Nov 19, 2023

💡 Summary

何かの拍子に無入力でも MkPostForm の canPost が true になる?
その場合にそのまま投稿ボタンを押すと無が投稿される
実際に

SELECT COUNT(*) FROM "public"."note" WHERE ("userHost" IS NULL) AND ("visibility"::TEXT = 'public') AND ("text" IS NULL) AND ("renoteId" IS NULL) AND ("cw" IS NULL) AND ("fileIds"::TEXT = '{}') AND ("hasPoll" = false)

すると何件か存在が確認できる

🥰 Expected Behavior

  • 投稿できるべきでないときは投稿ボタンが押せるべきでない
  • 投稿できるべきでないリクエストは失敗すべき

🤬 Actual Behavior

  • 投稿できるべきでないときもまれに投稿ボタンが押せる
  • 投稿できるべきでないリクエストが失敗しない

📝 Steps to Reproduce

再現方法は色々ある(被リンク参照)

💻 Frontend Environment

* Model and OS of the device(s):
* Browser:
* Server URL:
* Misskey:

🛰 Backend Environment (for server admin)

* Installation Method or Hosting Service:
* Misskey:
* Node:
* PostgreSQL:
* Redis:
* OS and Architecture:
@acid-chicken acid-chicken added the 🐛Bug Unexpected behavior label Nov 19, 2023
@acid-chicken
Copy link
Member Author

Related to #3361

@acid-chicken acid-chicken added the ❓needs more investigation A bug whose causes are unknown label Nov 20, 2023
@zyoshoka
Copy link
Contributor

#9902 (comment) で既に指摘されていますが、変換確定前の日本語入力のテキストが投稿されるノートに含まれないにも関わらず文字数の判定に含まれているので、変換確定前に投稿用のショートカットキーを押下することで虚無投稿を作成できるようです。

const textLength = $computed((): number => {
return (text + imeText).trim().length;
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛Bug Unexpected behavior
Projects
None yet
2 participants