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

Preserve comment contents during failed comment posting #148

Open
PubliqPhirm opened this issue Dec 3, 2021 · 1 comment
Open

Preserve comment contents during failed comment posting #148

PubliqPhirm opened this issue Dec 3, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@PubliqPhirm
Copy link

Describe the bug
When a comment is made and cannot be posted, all progress made typing it up is lost.

To Reproduce
I have found two routes so far.

Route 1: fastposting

  1. Open two tabs with images
  2. Start typing out a comment for each, but do not hit post just yet
  3. Press post for both tabs within 30 seconds (or whatever the too fast timeout is)
  4. The comment on the second image is totally gone when the posting too fast error is shown

Route 2: time-out

  1. Start typing a long comment
  2. Take a break and touch grass for 8 hours or otherwise be AFK for an excessive amount of time
  3. Finish typing your essay
  4. Press post
  5. The comment doesn't post and there's no way to recover its contents without having a time machine or precognition to copy it before smashing that post button.

Expected behavior

  1. The rejected comment is pre-populated into the comment field
  2. The page is scrolled to the comment box on reload (showing the rejected message)
  3. The error bar is mirrored near the comment box in addition to the very top of the page

Additional context
Specifically for the case of messages being rejected for posting too fast, we do need to make sure it's not too easy for spammers to resubmit the rejected comment. I propose using some heuristic of message length to separate which posts get returned to sender and which get blackholed in such a scenario. Admins of sites using Philomena would know the profile of spam messages better than me, but perhaps a starting metric for minimum comment length to be returned for posting too quickly is 180+200n where n is the number of URLs (not counting intra-site embeds) in the message. Messages that are too short would get blackholed.

@PubliqPhirm PubliqPhirm added the bug Something isn't working label Dec 3, 2021
@liamwhite
Copy link
Contributor

First case: see #85
Second case: this is probably because your CSRF token expired, so I'll likely track that one here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Nice To Have Todos
Development

No branches or pull requests

2 participants