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

fix: prevent Ctrl+Enter to spamming posts #698

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xnuk
Copy link

@xnuk xnuk commented May 17, 2023

everyday i press ctrl+enter in staging.bsky.app it sends 1000+ of same posts => so i temporaily ip banned => later i delete that spam posts => i temporaily ip banned => again

at://did:plc:vuwg6b5ashezjhh6lpnssljm/app.bsky.feed.post/3jvqn4idly52j

This solves this thing but in a bit of dirty way.

  1. onPressPublish in handleKeyDown is never changed, because useEditor only depends on modeClass.
  2. Also depending onPressPublish or richtext is impractical because it seems to reload the entire editor.
  3. So this PR tries to get latest values, on Ctrl+Enter pressed.

@ansh ansh requested a review from pfrazee June 13, 2023 18:32
@pfrazee
Copy link
Collaborator

pfrazee commented Jun 14, 2023

I tried to reproduce the "post spam" issue on chrome, firefox, and safari and was unable to, using either cmd+enter or ctrl+enter. Is this still an issue?

@xnuk
Copy link
Author

xnuk commented Jun 15, 2023

Good thing is, spamming Ctrl+Enter also can spam same posts. Firefox 115 in Arch Linux x64.

spam.mp4

Is this still an issue?

Creating my new account now to reproduce it

@xnuk
Copy link
Author

xnuk commented Jun 15, 2023

image

Still reproducible. Firefox 115 on Windows 10 + 날개셋 10.0 IME, Ctrl+Enter is pressed just once.

bandicam.2023-06-15.10-38-08-341.mp4

@pfrazee

@omergulen
Copy link

Also, since we are already on it, would you mind preventing Ctrl+Enter to add new line please? I have never seen this behavior before on any other Chat or post inputs, Ctrl+Enter should trigger the post submit and there shouldn't be new line added in the UI (even though it is not posted).

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

Successfully merging this pull request may close these issues.

3 participants