There is a very small bug when it comes to toggling favorites.

Steps to reproduce:

  • Open the same question in two tabs
  • In one tab, mark the question as a favorite
  • In the second tab, mark the question as a favorite

Result: Question is now "un-favorited", even though both tabs show that I have marked the question as a favorite. The reason is that the front-end display is not syncing with the back-end, despite the fact that each click will toggle your selection in the back-end.

Now you may think: That's stupid. Why would I open the same question in two tabs?

Here's how I noticed it. This happens in Chrome, other browsers are untested.

  • Open a question and mark it as favorite
  • Go to the location bar and enter a new URL (e.g. Google)
  • Hit the back button
  • The cached version of the page now shows that the question is not favorited, even though it is in the back-end
  • Select the question as favorite (again). This will make it appear as if the question is now favorited, when in fact you have now "un-favorited" the question in the back-end. Refresh to confirm.

I realize this is a small bug, but it is a bug nonetheless.

  • I believe it's the same in all "toggle mode" actions like upvotes and downvotes as well, isn't it? Apr 1, 2013 at 22:58
  • @ShaWizDowArd I tried this before posting and no, it is not the same. Upvotes function as expected, and as described by blahdiblah. This only seems to be a problem with favorites.
    – Jeff
    Apr 1, 2013 at 23:04
  • I've been stung by this bug a bunch of times, esp. when I do a search, open-in-new-tabs various results, and as I'm reading also open-in-new-tabs some of the links to other questions. Then as I go through the tabs I occasionally '+favorite' a question, keep going and inadvertently try to re-favorite the same question in another tab. The only solution, given that use case, is to reload the page before '+favorite'ing, if I have any doubt about having already seen the same question before in that session.
    – dubiousjim
    Jun 30, 2014 at 11:33

2 Answers 2


While this is somewhat esoteric, all API calls in general should be based on the actual state of the UI rather than the model on the server, even if the former is out of sync.

Concretely, if I click a button to add a favorite, the resulting API call shouldn't be "toggle favorite" it should be "add favorite". If my view is out of sync, such that I'm trying to add a favorite that I already have, the extraneous call should be ignored.


Given that we already do the right thing when it comes to up and down votes (send a vote based on the state of the UI, and no-op when it makes sense), I agree that this should be considered a bug.

It's fixed now. Note: if you already had tabs open and use the favorite button on a tab that has been open for more than a few minutes from right now, then you may experience the old behavior of blindly toggling. A refresh will take care of it (assuming away intervening web caches).

  • Yay. :) There's a dupe here you closed a while back that you may want to slap status-completed on too (not sure what the policy is for bothering with status- tags on dupes). meta.stackexchange.com/questions/193400/…
    – Mark Amery
    Sep 29, 2014 at 17:05
  • if it's closed then no need to put a status on it. Sep 29, 2014 at 17:06

You must log in to answer this question.

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