When voting on a post, users can click a the up or down vote buttons multiple times and the vote count increments on the client side.

This can introduce unwanted user behaviuor as in the backed, the user may unknowingly be voting, and undoing the vote multiple times, or commiting other hidden actions.

I have also seen the case where vote counts increment in 2s (2,4,6,8 etc) due to this bug.

I've tried suuppressing this javascript increment, but this introduces other unwanted behaviour.

Has anyone else had any luck correcting this bug?

asked 20 May '11, 06:38

Alex%20N's gravatar image

Alex N
16113
accept rate: 0%


according to this: http://jira.osqa.net/browse/OSQA-538 , this bug is fixed in rev954 .

@Alex-N , what version of OSQA are you running?

link

answered 21 May '11, 16:44

Andrew_S's gravatar image

Andrew_S ♦
5.6k45674
accept rate: 21%

edited 22 May '11, 01:37

I haven't seen this bug. But I'd have thought that it was pretty easy to solve in the javascript, e.g. by unbinding the click-handler for that button while the ajax is being done, and only re-binding it after it's finished and after the screen has been updated.

link

answered 20 May '11, 08:05

Andrew_S's gravatar image

Andrew_S ♦
5.6k45674
accept rate: 21%

Thanks Andrew. To replicate: click the upvote button on my question above for example multiple times to see the vote count keep incrementing in the front end.

(20 May '11, 08:57) Alex N

@Alex N, I just pounded the up-vote button like I was fighting for my life in Halo. It simply toggled back and forth from 0 to 1 as it should have. Is this possibly specific to your browser or some other environmental factor?

(20 May '11, 09:01) rickross ♦♦

In Google Chrome 12 and in Firefox 4, it toggles between 0 and 1.

In IE8, it does as @Alex N says, and just keeps incrementing.

(20 May '11, 09:08) Andrew_S ♦

Thanks, @Andrew_S, that's good info. So, we're OK on Firefox and Chrome, but this problem is reproducible in IE? I'll ask Jordan to investigate.

(20 May '11, 09:10) rickross ♦♦

Yup. But hey, which web-developer doesn't hate IE?

(20 May '11, 09:13) Andrew_S ♦

Ah - should've guessed it would be an IE 'quirk'. Thanks for the testing feedback. I'll concentrate efforts on the client-side code.

(20 May '11, 10:55) Alex N
showing 5 of 6 show 1 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×166
×43
×9
×7
×3

Asked: 20 May '11, 06:38

Seen: 705 times

Last updated: 22 May '11, 01:37

powered by OSQA