Arc Forumnew | comments | leaders | submitlogin
Bug with voting on the forum
5 points by absz 6144 days ago | 7 comments
EDIT: Whoops, it's not actually a bug. The multiple-vote-increase is just on the current page (though it'd be nice if it didn't even do this, but still). Only one of the votes is actually registered. Thanks, lojic!

I was reading the forum when I came across I comment I agreed with wholeheartedly. Thinking to be emphatic, I clicked several times on the up-arrow link for said comment. Imagine my surprise when, instead of going up just once, the comment's points went up for every click! It seems that on clicking "up" or "down," the image disappears, but not the link. Upon refreshing the page, I could no longer vote--the voting links had disappeared. It appears that the problem is in the variable votejs* in news.arc: in the vote JS function, the lines

  byId('up_'   + item).style.visibility = 'hidden';
  byId('down_' + item).style.visibility = 'hidden';
cause the images to disappear, but not the links themselves. On examining the function and the generated HTML, I'm not sure why this breaks--it doesn't seem like it should--but I am no expert.

I'm using Safari 3.0.4 on Mac OS X 10.5 on an Intel MacBook, in case it's a bug or oddity here instead of in news.arc.



6 points by lojic 6144 days ago | link

I expect that the server doesn't continue to accept votes, so you're probably just seeing a transient increase on the page you're viewing.

Does a refresh return the vote to what you'd expect (i.e. only one vote up or down) ?

-----

2 points by absz 6144 days ago | link

Aha, you are correct (I tested with your comment :)). Now why didn't I think of that? Oh well. Thanks!

Though it would be nice if it didn't even do that, but that's much more minor.

-----

4 points by lojic 6144 days ago | link

I think it's reasonable for you to point this out even if it's only a cosmetic problem. Good catch.

-----

3 points by bogomipz 6144 days ago | link

Is this browser dependent? In Firefox 2.0.0.12 on Linux, I can't reproduce what you describe. After the first click, clicking on the same spot has no effect at all.

-----

1 point by absz 6144 days ago | link

Then it probably is browser-dependent (I thought it might be). It's a quirk of setting something hidden, I suppose.

-----

5 points by ryantmulligan 6143 days ago | link

I'm this same post was on news.yc more than a year ago.

-----

1 point by absz 6143 days ago | link

Oh, was it? I'm sorry. I don't read that site, so I didn't know that.

-----