# Admin - Users: tab switching breaks content

**URL:** https://meta.discourse.org/t/admin-users-tab-switching-breaks-content/109805
**Category:** Bug
**Created:** [22 februari 2019 om 08:19 UTC](https://meta.discourse.org/t/admin-users-tab-switching-breaks-content/109805 "2019-02-22T08:19:00Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Lure](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lure/32/130462_2.png) [@Lure](https://meta.discourse.org/u/Lure)
#### Post date: [22 februari 2019 om 08:19 UTC](https://meta.discourse.org/t/admin-users-tab-switching-breaks-content/109805/1 "2019-02-22T08:19:00Z")

</div>

I have noticed a bug in Admin/Users: if you switch tabs (Active, New, Suspended) quickly, you may end up with list of users populated from previous tab. I noticed this when I was switching from Active to Staged and was confused to find whole user list (active) on Staged list (with Staged users header).

BTW, I also find Groups tab annoying, as it does not have same navigation as other tabs: when you select it, you loose navigation and need to go back or restart from top. Groups is also broken on top menu - same behaviour.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [22 februari 2019 om 08:24 UTC](https://meta.discourse.org/t/admin-users-tab-switching-breaks-content/109805/3 "2019-02-22T08:24:05Z")

</div>

Will have a look at this today.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [23 februari 2019 om 08:34 UTC](https://meta.discourse.org/t/admin-users-tab-switching-breaks-content/109805/4 "2019-02-23T08:34:17Z")

</div>

I have been clicking tabs for a longer time than I’m willing to admit and never reproduced this. Can you consistently reproduce this? What’s your browser? Is it on desktop or mobile?

---

<div class="post-metadata">

### Author: ![Lure](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lure/32/130462_2.png) [@Lure](https://meta.discourse.org/u/Lure)
#### Post date: [23 februari 2019 om 09:39 UTC](https://meta.discourse.org/t/admin-users-tab-switching-breaks-content/109805/5 "2019-02-23T09:39:27Z")

</div>

Interesting, I cannot reproduce it now anymore. It was on Chrome/Mac, however browser just updated today, but I doubt it was that that “fixed” it. Will do some more testing…

---

<div class="post-metadata">

### Author: ![Lure](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lure/32/130462_2.png) [@Lure](https://meta.discourse.org/u/Lure)
#### Post date: [23 februari 2019 om 09:42 UTC](https://meta.discourse.org/t/admin-users-tab-switching-breaks-content/109805/6 "2019-02-23T09:42:02Z")

</div>

Reproduced it: it seems it is related to sort order. When I have changed the sort order to Created (last column) on Active users, it was easy to reproduce again. I got all active users listed as Suspected (otherwise empty list).

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [23 februari 2019 om 10:01 UTC](https://meta.discourse.org/t/admin-users-tab-switching-breaks-content/109805/7 "2019-02-23T10:01:15Z")

</div>

Nice, I think I can repro something now, will work on a fix next week 👍

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [25 februari 2019 om 08:51 UTC](https://meta.discourse.org/t/admin-users-tab-switching-breaks-content/109805/8 "2019-02-25T08:51:08Z")

</div>

This should be fixed by:

> <https://github.com/discourse/discourse/pull/7058>
>
> A first load was happening in route, which was setting properties on controller.… These properties were observed on the controller and were triggering a reload of the AdminUser model.
> 
> Not only was it doing loading two times it was also sometimes resulting on the controller model refresh end to happen after route has been changed, resulting in a wrong model.

I’m waiting on some review here before merging, note sure this is the best fix. The test I added catches the previous failure.

EDIT: merged

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [26 februari 2019 om 09:45 UTC](https://meta.discourse.org/t/admin-users-tab-switching-breaks-content/109805/9 "2019-02-26T09:45:24Z")

</div>


