It happens to me, at least in this site, that sometimes when I press "follow" it glitches to "You’re no longer following this question".
I have to refresh the page to get the expected behaviour.
It happens to me, at least in this site, that sometimes when I press "follow" it glitches to "You’re no longer following this question".
I have to refresh the page to get the expected behaviour.
I can't repro this, and as only one user is reporting this issue, I can't justify the opportunity cost on spending more time on this.
That said, I am kind of baffled as to how this is happening, so will explain some of the code logic, and maybe you will see something on your client side that could help to debug this (or force a repro).
When the follow button is clicked, a function runs on the client side that does (among other things):
PostId
of the question/answer on which it is being runaria-pressed
attribute on the [Follow] button.
true
then it means that you are currently following false
then it means that you are not yet followingnewIsFollowing
if (newIsFollowing)
(ie: if you are trying to follow something that you weren't following before) then display the "you are now following" popover.else
(ie: you were following, and now you are no longer following) then display the toast info messageSo based on what you are writing, you are submitting a request to follow (5.1) and getting the feedback notice from a request to unfollow (5.2). So I am just completely stumped as to how this is happening. I would normally blame a double-submission, but that is hard to do with the button being disabled (unless there is something in your browser that is not observing the disabled
prop on the button), and even so - if you double-submitted and reloaded the page, you would no longer be following.
Would be good to know the value of aria-pressed
on your follow button before you clicked on it, and also to see your network tab to make sure that there is only one ajax call being made.
But like I said, I can't spend more time on this now. Please let me know if something comes up to make the issue more evident.
StackExchange.question.fullInit()
, since that causes the follow link to trigger twice, once to follow and immediately unfollow after.
Commented
May 26, 2020 at 9:17
StackExchange.question.init()
is called by a userscript, in at least some instances. However, I haven't specifically looked at if it affects follow/following.
init()
calls fullInit()
under the hood, for logged-in users, so it makes no difference, and that any userscript using either functions need to rethink whether it is really necessary to call this function.
Commented
May 27, 2020 at 7:16
init
or fullInit
more than once, you get the above error when following any post. Since the function is already used by the site itself, no userscript should be using this.
Commented
May 27, 2020 at 7:17
This has just happened to me on this question https://stackoverflow.com/questions/62117063/how-to-hide-the-div-with-the-form-and-post-data-to-database-and-show-a-hidden-di
I believe it has something to do with the button "Load new answers". When you have the page open and someone adds a new question then the button appears. Once you dynamically load the new answers the "follow" button seems to glitch. Maybe. It could also be caused by dynamically loaded comments under the question.
This post continues in meta:
Follow button glitches when a new answer is loaded up via AJAX
$('#btnFollowPost-62117063').length
and it says there is only 1
$("*#...")
Commented
May 31, 2020 at 14:38