# Badge details page shows a "undefined" user and debounce issues

**URL:** https://meta.discourse.org/t/badge-details-page-shows-a-undefined-user-and-debounce-issues/41664
**Category:** Bug
**Created:** [2016 年3 月 28 日 18:56 UTC](https://meta.discourse.org/t/badge-details-page-shows-a-undefined-user-and-debounce-issues/41664 "2016-03-28T18:56:11Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### 作者： ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)
#### 发布日期： [2016 年3 月 28 日 18:56 UTC](https://meta.discourse.org/t/badge-details-page-shows-a-undefined-user-and-debounce-issues/41664/1 "2016-03-28T18:56:11Z")

</div>

[https://meta.discourse.org/badges/13/first-flag](https://meta.discourse.org/badges/13/first-flag)

 ![](https://global.discourse-cdn.com/meta/original/3X/2/c/2c836ec8fe0e3f7266283eed4f96a9fed85b4709.png)

EDIT: a dangling badge shows when associated user is deleted.

* * *

Debounce issues repro:

1. around 300px height browser window
2. Keep fast scroll down.
3. I requested twice around `96` offset in three tries.

---

<div class="post-metadata">

### 作者： ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### 发布日期： [2016 年3 月 28 日 19:05 UTC](https://meta.discourse.org/t/badge-details-page-shows-a-undefined-user-and-debounce-issues/41664/2 "2016-03-28T19:05:22Z")

</div>

That user was deleted – so that’s why they don’t show up.

---

<div class="post-metadata">

### 作者： ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### 发布日期： [2016 年3 月 28 日 20:46 UTC](https://meta.discourse.org/t/badge-details-page-shows-a-undefined-user-and-debounce-issues/41664/3 "2016-03-28T20:46:23Z")

</div>

Most of the default Badges are revocable.

For those, when the queries are run again revoked badges won’t show on their pages.

A few of the default Badges are _not_ revocable i.e.  
Reader  
First Flag  
Anniversary  
Hot Link  
Famous Link

For those, once they’re there, they’re there.

I guess the logic of First Flag is to award it when the Flag feature is used, regardless of whether or not the Flag was Agreed or not. It isn’t First _Good_ Flag after all.

Unfortunately I don’t see an easy CSS fix for removing the div entirely or the “granted at” from the page.

---

<div class="post-metadata">

### 作者： ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)
#### 发布日期： [2016 年3 月 29 日 05:26 UTC](https://meta.discourse.org/t/badge-details-page-shows-a-undefined-user-and-debounce-issues/41664/4 "2016-03-29T05:26:58Z")

</div>

Hiding them is quite easy but since the root cause is that badges are not revoked when a user is deleted.

Might worth cleaning them anyways

---

<div class="post-metadata">

### 作者： ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### 发布日期： [2016 年3 月 29 日 05:27 UTC](https://meta.discourse.org/t/badge-details-page-shows-a-undefined-user-and-debounce-issues/41664/5 "2016-03-29T05:27:19Z")

</div>

Yeah we should clean these things up on deletion… having a look at sorting this out.

Note, we already have “dependant destroy”, so something fishy is up.

---

<div class="post-metadata">

### 作者： ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### 发布日期： [2016 年3 月 29 日 05:41 UTC](https://meta.discourse.org/t/badge-details-page-shows-a-undefined-user-and-debounce-issues/41664/6 "2016-03-29T05:41:47Z")

</div>

This fixes the orphan issue:

> <https://github.com/discourse/discourse/commit/418bc4a844820352f7ab94400c5e51285b000967>

---

<div class="post-metadata">

### 作者： ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### 发布日期： [2016 年3 月 29 日 05:57 UTC](https://meta.discourse.org/t/badge-details-page-shows-a-undefined-user-and-debounce-issues/41664/7 "2016-03-29T05:57:19Z")

</div>

This fixes the second issue:

[https://github.com/discourse/discourse/commit/7ab153dac3c7111451d186486964dab9d7e5855f](https://github.com/discourse/discourse/commit/7ab153dac3c7111451d186486964dab9d7e5855f)

But please, in future, one bug report per topic.

---

<div class="post-metadata">

### 作者： ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### 发布日期： [2016 年3 月 29 日 05:57 UTC](https://meta.discourse.org/t/badge-details-page-shows-a-undefined-user-and-debounce-issues/41664/8 "2016-03-29T05:57:24Z")

</div>


