In a support thread titled “Why didn’t I receive the Gives back badge?”, user steko questioned why they lacked the badge despite giving 464 likes and receiving 128, which seemingly met the criteria of 100 likes given and received. Mittineague suggested checking if the daily badge job had run or if the likes occurred in categories where badges are allowed, providing the underlying SQL query for reference. codinghorror requested eviltrout investigate. eviltrout clarified that the badge is actually awarded based on the number of posts that received a like, not the total count of likes; steko had only 57 liked posts. steko agreed that the badge description was misleading. codinghorror acknowledged the error and confirmed they had updated the long description to accurately reflect the requirement of having 100 liked posts.
First off, let’s clarify that I’m using myself as an example just to make sure the issue I’m seeing is not a bug somewhere in the badge machinery
The Gives back badge
is granted when you’ve received 100 likes and have given 100 or more likes in return.
Cool! So I gave 464 likes and received 128, I should totally have this badge, but no, I don’t. I see users with similar numbers in likes received/given than me who have it, so what happened? Is a certain ratio needed as with other badges?
Were all of the Likes in Categories that granted badges? i.e. the setting
“Allow badges to be awarded in this category”
* note, messages don’t have a category
If you prefer code the query is
SELECT us.user_id, current_timestamp AS granted_at
FROM user_stats AS us
INNER JOIN posts AS p ON p.user_id = us.user_id
WHERE p.like_count > 0
AND us.likes_given >= 100
AND (:backfill OR us.user_id IN (:user_ids))
GROUP BY us.user_id, us.likes_given
HAVING COUNT(*) > 100
The query is based on the number of posts that have received a like, not the total number of likes received. You’ve only had 57 posts that have received a like.
The short description of “Has 100 liked posts and gave 100 likes” seems more accurate than the long description.