[HN Gopher] Tell HN: Voting on HN Fails Silently
       ___________________________________________________________________
        
       Tell HN: Voting on HN Fails Silently
        
       If you upvote or downvote a post on Hackernews, and it failed (e.g.
       because you have hit the 1-request-per-second limit), there is no
       error, and the vote silently fails.  Only if you refresh the page
       will you see that your vote actually didn't go through.
        
       Author : axiosgunnar
       Score  : 16 points
       Date   : 2022-02-12 21:24 UTC (1 hours ago)
        
       | samwillis wrote:
       | On mobile so can't check but from memory there is very simplistic
       | JavaScript on the pages and the vote buttons are just links
       | (maybe form Post buttons) that return a http 204 (no content)
       | response that effectively stops the browser from doing anything.
       | The vote counts is just a preemptive ui update with no error
       | checking.
       | 
       | It's always been this way.
       | 
       | https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204
        
         | colejohnson66 wrote:
         | Yep. They're simply <a> tags. The code inside `onclick` is very
         | primitive:                   if (u.pathname == '/vote') {
         | vote(p.get('id'), p.get('how'), p.get('auth'), p.get('goto'));
         | }
         | 
         | `vote` just sees if it's an up or a down, set's the unvote
         | link's `innerHTML`, then, curiously, uses an `Image` object to
         | make the request:                   new Image().src = vurl(id,
         | how, auth, _goto);
         | 
         | The code is only 152 lines and is very easy to read:
         | https://news.ycombinator.com/hn.js
        
       | version_five wrote:
       | Related, my account is shadow-blocked from up/down voting posts,
       | and I think from flag/vouch as well. I think there was a period
       | where I was too aggressive in moderation and it must have
       | triggered something.
       | 
       | I can test this by checking a poster's karma before and after
       | voting - I used to be able to see the increment/decrement and now
       | I can't.
       | 
       | I can still upvote stories.
        
         | shock wrote:
         | Same in my case. At the end of the day, it's just another form
         | of censorship. It broke the illusion I had of HN being
         | something special and I'm glad it did. Better spend that energy
         | elsewhere.
        
       | MerelyMortal wrote:
       | My votes fail silently if I click on whatever link to read the
       | article to see if it's any good or not, then click the browser
       | back button to go back to HN to then upvote. After I vote, I
       | always manually refresh the page, and indeed it didn't go through
       | so then I have to click the upvote button again.
        
       | fsflover wrote:
       | I can confirm. For this reason I'm constantly refreshing the page
       | if I think my vote is important.
        
       ___________________________________________________________________
       (page generated 2022-02-12 23:01 UTC)