Award emoji tooltips showing "me" twice.
Summary
Came across this while working on #18334 (closed)
If your name (me) is the only name in the tooltip, the javascript fails to remove it. Then clicking again will add another "me."
This is reproducible on the current release.
Steps to reproduce
-
Go to any issue with zero thumbs (or use any new emoji)
-
Click thumbs up
-
REFRESH THE PAGE
-
Click to remove your thumbs up
(Note the tooltip still says "me")
-
Click to re-add the thumbs up
(The tooltip should now say "me, me")
Expected behavior
In step 4 there should be no tooltip
In step 5 the tooltip should just say "me"
Relevant logs and/or screenshots
Current tooltips for step 4 and 5
Possible fixes
This appears to be a problem with the logic in getAwardTooltip
in awards_handler.coffee
getAwardTooltip: ($awardBlock) ->
return $awardBlock.attr('data-original-title') or $awardBlock.attr('data-title') or ''
Tooltip data is in data-title
when the page first loads. The removeMeFromUserList
assigns the new tooltip to data-original-title
.
This works in most cases, but when the new tooltip is an empty string data-original-title
resolves to false and getAwardTooltip
returns the old tooltip instead.