~sircmpwn/todo.sr.ht#124: 
Prevent double submission for comments

You can easily accidentally submit a comment twice if the form submit request loads slowly. This is easily fixable with javascript but not as easy without it.

Status
REPORTED
Submitter
~martijnbraam
Assigned to
No-one
Submitted
6 years ago
Updated
4 years ago
Labels
beta

~sircmpwn 5 years ago

Suggested approach: issue a comment token when you load the page and stick it in the form. Stick that token in redis on submission to prevent dupes.

~eb 4 years ago

Perhaps easier is to have a set of hash(user ID + thread + message) and check if it's unique. Can't see why you would want to post the same message twice in the same thread.

Register here or Log in to comment, or comment via email.