What is meta? ×

I've noticed this bug for a while now: whenever I cast a vote on a question or answer in StackOverflow, then proceed to navigate to another page or refresh the same page (within roughly 5-10 seconds), I observe that my vote has disappeared. This is somewhat irksome in that it forces me to wait for at least 10 seconds before closing any page on which I have just voted.

This would seem to be a bug in the AJAX functionality of voting, and I suspect there is no technical reason for this behaviour. Surely it's not taking up to 10 seconds for the AJAX request to be sent. (My internet is running nice and speedily otherwise.) I should note that this has happened for me in Firefox 3.5, though I haven't tested on other browsers.

Can anyone else confirm this bug? It would be helpful to have it fixed in the near future.

share|improve this question
I can replicate in Chrome, but like random says, the vote is actually there, it's just not rendered until you reload the page. –  Dominic Rodger Oct 2 '09 at 14:17
@Jeff: Care to comment on this? Are you agreed that this is simply a caching issue that we have to live with? –  Noldorin Oct 2 '09 at 23:23
add comment

3 Answers

up vote 4 down vote accepted

I get "lost" votes in two ways:

  • Vote and immediately close the browser. In this case the vote is really lost, because I closed before the ajax request was sent. That's my own fault, or at worst the browser's fault. Not much SO can do to make it better, unless you count requiring a full page refresh every time I cast a vote (which I would not want). This is also really rare and hard to reproduce.

  • Vote. Navigate to another page. Hit the back button. What's happening now is that I'm seeing a cached view of the page from the previous time I requested it. If I refresh the page, I can see the vote again. The key thing here is that no new request was sent to the SO web server when I saw the page with the "missing" vote. I suspect this is what's really happening with the OP, as well. It could likely be fixed by changing how the server tells the browser to the cache responses, but imo it's not worth it.

share|improve this answer
I agree, this sounds like a simple back button cached page issue to me –  Jeff Atwood Oct 2 '09 at 20:20
+1. I guess the back button theory is what happened to me. –  LeakyCode Oct 2 '09 at 20:53
Yeah, seems like a sound analysis to me. Indeed, there would seem to be two somewhat separate issues here. –  Noldorin Oct 2 '09 at 23:21
add comment

Spotted this behaviour every now and then. Nothing major.

Vote, see it stick. Then refresh the page. Vote is no longer there.

Reload the page once more, vote was there all along!

share|improve this answer
I've also seen a vote dissapear and reappear when refreshed. –  user27414 Oct 2 '09 at 13:21
Me too. Probably a cache issue. –  LeakyCode Oct 2 '09 at 13:24
Strangely enough, I don't think it's a caching issue; when I try to vote again after it disappears, it lets me do so, which shouldn't be the case if the vote was actually registered on the server, no? Also, this happens on a semi-regular basis for me. –  Noldorin Oct 2 '09 at 13:27
Noldorin: Indeed. Yes. This is the behavior I observed. Weird. –  LeakyCode Oct 2 '09 at 13:44
add comment

Another reason: The pages are cached on the web server itself, so most of the times we see a cached view. The vote is in the database, just hasnt made it into the cache. The next time the cache is refreshed, your vote will show up.

share|improve this answer
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .