# Bulk adding members to a group is broken

**URL:** https://meta.discourse.org/t/bulk-adding-members-to-a-group-is-broken/81183
**Category:** Bug
**Created:** [2월 21, 2018, 10:21오후 UTC](https://meta.discourse.org/t/bulk-adding-members-to-a-group-is-broken/81183 "2018-02-21T22:21:04Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [2월 21, 2018, 10:21오후 UTC](https://meta.discourse.org/t/bulk-adding-members-to-a-group-is-broken/81183/1 "2018-02-21T22:21:04Z")

</div>

I’ve come across a bug with bulk adding members to a custom group. I can repro it on try.

Repro steps:

1. Create a new custom group
2. Bulk add (58)users to group using username
3. The upload appears to work: [https://try.discourse.org/groups/Experienced](https://try.discourse.org/groups/Experienced)

But group appears to have (and acts as if it has) no members

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/6/161e521024fd235e946032d11d1d748e0dce2e76.png)

Manually joining the group causes this to happen:

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/0/10d236ebba2f34a5145d7f6b790bf34cd8832fb0.png)

But leaving then causes this:

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

I thought it was related to [this](https://meta.discourse.org/t/bulk-add-to-group-does-not-increment-group-membership-counts/52631/2) but it’s not just the count – the functionality (i.e. tagging the group) doesn’t work.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2월 21, 2018, 11:57오후 UTC](https://meta.discourse.org/t/bulk-adding-members-to-a-group-is-broken/81183/2 "2018-02-21T23:57:11Z")

</div>

Hmm can you take a look @techAPJ and see if you can repro too?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2월 22, 2018, 6:09오전 UTC](https://meta.discourse.org/t/bulk-adding-members-to-a-group-is-broken/81183/4 "2018-02-22T06:09:31Z")

</div>

> [@HAWK](#):
>
> But leaving then causes this:

This is indeed because we do not update group user count when bulk adding users. The count is updated every 12 hours in `EnsureDbConsistency` job.

> [@HAWK](#):
>
> the functionality (i.e. tagging the group) doesn’t work.

Does that mean mentioning the group in topics/posts is broken? It is working for me on try for that group.

> **[Welcome to our demo!](https://try.discourse.org/t/welcome-to-our-demo/57/17?u=techapj)**
>
> (post deleted by author)

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [2월 22, 2018, 10:13오후 UTC](https://meta.discourse.org/t/bulk-adding-members-to-a-group-is-broken/81183/5 "2018-02-22T22:13:28Z")

</div>

> [@techAPJ](#):
>
> Does that mean mentioning the group in topics/posts is broken? It is working for me on try for that group.

Is it actually working though? I get this (and it’s the same on my other site even after 24 hours and the count has updated):

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

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2월 23, 2018, 2:15오전 UTC](https://meta.discourse.org/t/bulk-adding-members-to-a-group-is-broken/81183/6 "2018-02-23T02:15:08Z")

</div>

Interesting, this might be a regression in mentioning groups. I’ll look into it today.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2월 23, 2018, 9:02오전 UTC](https://meta.discourse.org/t/bulk-adding-members-to-a-group-is-broken/81183/7 "2018-02-23T09:02:55Z")

</div>

The mention notifications were getting sent, but looking at that warning I agree that this looks very confusing to end user.

I added the code to update group user count when bulk adding users to a group.

[https://github.com/discourse/discourse/commit/709f201bd4a7d6e1e02a1d84cf035d0628b31c50](https://github.com/discourse/discourse/commit/709f201bd4a7d6e1e02a1d84cf035d0628b31c50)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2월 23, 2018, 9:03오전 UTC](https://meta.discourse.org/t/bulk-adding-members-to-a-group-is-broken/81183/8 "2018-02-23T09:03:13Z")

</div>


