20

I just tried upvoting the following Documentation example:
https://stackoverflow.com/documentation/html/722/selection-menu-controls/1013/select-menu#t=201607191602232628214

The upvote seems to work:

enter image description here

Yet as soon as I refresh the page, the upvote disappears:

enter image description here

I don't know if the fact that I am one of the contributors to the example has anything to do with this bug. Another factor might be that another contributor to this example just upvoted the same example 45 minutes ago. I checked the two other contributors for the examples' reputation, and while points were awarded for the first upvote that someone else did today, nothing was rewarded for the upvote that I just unsuccessfully tried to implement.


Update:

As per comments below, @Neal seems to have been able to successfully upvote that post so it doesn't seem to be the example that is the problem. It however for some reason is still not working for me, so it might be user specific or related to the fact that I am one of the contributors.

As for @Kendra's suggestion, I waited a few minutes, tried upvoting again, left the page alone for a few minutes before refreshing the page, and the upvote still disappeared.

16
  • It sticks for me.
    – Naftali
    Commented Jul 19, 2016 at 16:26
  • @Neal I just tried again and it is still not sticking for me on that post. Like I mentioned in the question, another user was able to upvote the same question today, so all upvoting does not seem to be broken, yet something seems to be up with that specific post.
    – Tot Zam
    Commented Jul 19, 2016 at 16:31
  • I was able to upvote that post. And it stuck.
    – Naftali
    Commented Jul 19, 2016 at 16:32
  • The main site does this for me on occasion. It's normally just a request taking longer than usual. Give it a bit and try again. (On occasion I'll also vote, refresh to find the vote gone, then refresh again to see it truly did stick.) There's not much the team can do if your request is taking a longer time than usual to register.
    – Kendra
    Commented Jul 19, 2016 at 16:32
  • @downvoters I still can't upvote the example, so even if it works for you, something is still broken for my account.
    – Tot Zam
    Commented Jul 19, 2016 at 16:44
  • 9
    This is a perfectly legitimate bug report, even if it's caused by something strange on the OP's end. I'm not sure what these downvotes are all about.
    – user50049
    Commented Jul 19, 2016 at 16:52
  • Regarding your update, it does sometimes take me an hour or two to have an upvote request go through, so that still doesn't rule out that possibility. Just as a heads up. (I'm not saying it's definitely that, just that it's entirely possible.) If no other suggestions get made for what it could be, I'd just keep waiting a bit (maybe longer than a few minutes and closer to a half hour at a time?) and try again.
    – Kendra
    Commented Jul 19, 2016 at 16:58
  • As an added note, are you seeing any console errors when you try to upvote?
    – Kendra
    Commented Jul 19, 2016 at 16:58
  • 4
    @Kendra an hour or two? Woah, any idea why?
    – user50049
    Commented Jul 19, 2016 at 16:58
  • @TimPost My connection here at work just sometimes sucks. :) Nothing on your guys' end in my case. By "an hour or two" I don't mean for the one request, I mean to get a vote request to go through, with a few retries intermittently.
    – Kendra
    Commented Jul 19, 2016 at 16:59
  • @Kendra Nope, no error in the console. The orange arrow originally appears, so it seems like the initial part of an upvote works. It is when I refresh the page that it disappears. And my internet connection is quiet fast so that is not the problem either.
    – Tot Zam
    Commented Jul 19, 2016 at 17:01
  • Can you upvote any other posts anywhere else on the site? Or are all upvotes for you right now not sticking? That could also help narrow this down.
    – Kendra
    Commented Jul 19, 2016 at 17:02
  • 1
    If you're using Chrome, can you open the Network tab in dev tools and then upvote the post? Find the entry for /documentation/html/vote-on-example/1013/2?isUndo=false and paste the contents of the "response" tab into your question.
    – Shog9
    Commented Jul 19, 2016 at 17:07
  • @Kendra I was able to successfully upvote both another example that I contributed to and an example that I didn't contribute to, so it seems like it is just this example.
    – Tot Zam
    Commented Jul 19, 2016 at 17:09
  • @Shog9 I don't see /documentation/html/vote-on-example/1013/2?isUndo=false, but I see 2?isUndo=false. Is that the correct one? All that it says there is {"ResultType":1,"Message":""}.
    – Tot Zam
    Commented Jul 19, 2016 at 17:12

2 Answers 2

24

A vote on that example was recorded for you on April 18th at 13:11:59. Therefore, the system will not allow you to upvote it again.

...However, the system should allow you to retract it, and even failing that should indicate that you've previously voted. Failing both of those, the system should still be providing you with an informative error message.

None of that is occurring, probably because your vote was recorded when the example was attached to a different topic.

Apparently, re-parenting an example fails to remap the TopicId on all associated votes, thus breaking some assumptions in the voting code.

Recommendations:

  1. Fix topic reparenting to correctly remap the topic in all associated votes
  2. Fix old data with incorrect topics
  3. If #1 and #2 are not feasible, fix whatever assumptions are present in the voting logic to adapt gracefully to mismatched topic and example IDs on old votes.
1
  • I don't remember if I previously upvoted or retracted my vote, but this makes sense. And yes, it should at least give notification of why the vote is not going through.
    – Tot Zam
    Commented Jul 19, 2016 at 17:17
5

Votes are currently loaded by topic id - and the example move code didn't update existing votes' topic ids when moving :(

As the topic id really isn't needed here, we'll just drop that FK, so example moves don't need to do any updating.

TL;DR: a fix will be coming soon.

3
  • So, instead of lookup vote by topic id then example id, you just go lookup votes by example id?
    – Braiam
    Commented Jul 20, 2016 at 19:53
  • 1
    Exactly - query will just pass in the visible example ids. Commented Jul 20, 2016 at 19:53
  • 1
    My upvote is now showing up.
    – Tot Zam
    Commented Jul 21, 2016 at 14:48

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