~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
1 year, 7 months ago
Updated
5 months ago
Labels
No labels applied.

~sircmpwn 1 year, 1 month 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 5 months 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.