Badges/quests still completed before action's completed
If I have a quest to say, pet 6 piggies, then upon clicking "Pet" on the sixth piggy, the quest is immediately completed. The actual petting action finishes later. The same is true for badges of a similar nature.