main ← fix-badge-state-leak
approved 05:07PM - 09 Sep 26 UTC
Reported here: https://meta.discourse.org/t/visual-bug-checkmarks-on-badges-appe…ar-in-profiles-instead-of-the-badges-page/411831
If you visit `/my/badges`, and click through to the badge page (.e.g, `badges/130/licensed`), then return to your profile the badge state from the badge page leaks through... so you get a green checkmark icon that should never appear on your profile, as this is already a list of granted badges
<img width="1111" height="261" alt="image" src="https://github.com/user-attachments/assets/720eed7e-89b3-4863-a65b-1aab773181d2" />
additionally `has_badge` is stored in shared cache, so when clicking the badge from your profile you can see the granted state flicker on before the transition completes
the fix is to only let the badge index and global badge pages write to `has_badge`, and to have `DBadgeCard` get the badge explicitly from a `@granted` argument that isn't present on user profiles