Prevent duplicate forum posts when double-clicking

Bug #568140 reported by François Marier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Hugh Davenport

Bug Description

Some people seem to submit their posts twice when they post something to the forums. My guess is that they accidentally double-click the submit button.

We should be able to detect this and prevent the double posts either server-side (ideally) or at the very least in Javascript directly in the browser.

Tags: nojs
Changed in mahara:
importance: Undecided → Low
milestone: none → 1.3.0
status: New → Triaged
status: Triaged → Confirmed
Revision history for this message
Ruslan Kabalin (rkabalin) wrote :

Did not manage to replicate, even if you click the Post button multiple times, only one post is submitted.

Revision history for this message
Andrew Nicols (dobedobedoh) wrote :

Also unable to replicate this bug with Javascript turned on.

Revision history for this message
Andrew Nicols (dobedobedoh) wrote :

If I disable javascript, I can hit the Post button multiple times. Javascript already exists to prevent this.

So we're instead looking at a server side alternative.
We could try selecting any forum posts with the same poster, subject and body posted within a reasonable time frame (1 second will probably suffice). If they exist, don't add the new post.

However, this does seem a little ungraceful. Should we, for example, offer any error message?

Revision history for this message
Andrew Nicols (dobedobedoh) wrote :

Suggest moving the target for this to 1.3.1

Changed in mahara:
milestone: 1.3.0 → none
Revision history for this message
Hugh Davenport (hugh-davenport) wrote :

I can confirm this is still an issue on master with javascript disabled

Revision history for this message
Hugh Davenport (hugh-davenport) wrote :
Changed in mahara:
status: Confirmed → In Progress
assignee: nobody → Hugh Davenport (hugh-catalyst)
tags: added: nojs
Revision history for this message
Hugh Davenport (hugh-davenport) wrote :

This approach checks whether the same content was posted less than 5 seconds ago. The user could still "spam" the submit button for longer than 5 seconds to get a double post, and again after another 5 seconds etc...

Changed in mahara:
milestone: none → 1.5.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/867
Committed: http://gitorious.org/mahara/mahara/commit/4ed6f2a0daff09ff3780c91509f7b67b787ca580
Submitter: Francois Marier (<email address hidden>)
Branch: master

commit 4ed6f2a0daff09ff3780c91509f7b67b787ca580
Author: Hugh Davenport <email address hidden>
Date: Thu Nov 17 10:44:31 2011 +1300

    Stop accidental double posting in forums

    Bug #568140

    This problem only occurs when Javascript is disabled.
    This is one possible fix, which doesn't require changes to
    the database schema.

    Change-Id: I434a2806010acd9848622032258fca84e91e5b16
    Signed-off-by: Hugh Davenport <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Melissa Draper (melissa)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.