# Limits on personal messages vs topics

**URL:** https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930
**Category:** Bug
**Created:** [November 1, 2020, 5:48pm UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930 "2020-11-01T17:48:46Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [November 1, 2020, 5:48pm UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/1 "2020-11-01T17:48:46Z")

</div>

I believe I have hit a bug, but someone in the know will need to confirm this.

In our community our members need to send many personal messages around some periods of the month. To accommodate for this, we have increased `max personal messages per day` from the default of 20 to 50 which is a level we determined was enough for their needs (we are awareness of the issues with potential spam — we handle that through other means).

However, our members are getting blocked after sending just 20 messages, due to a different limit:

 ![Screenshot_2020-11-01 WOTM November 2020](https://global.discourse-cdn.com/meta/original/3X/5/4/54ee41313fdce57afc80709aeb5bc685be10f3a3.png)

Now, I know that technically messages are pretty much a topic, but I still didn’t expect that after changing the setting for personal messages since there’s a separate one for creating topics per day:

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

Our understanding from our tests is that the `max personal messages per day` limit doesn’t apply to the number of _replies_, so effectively, it is a limit on new “message topics” per day. With that, these two settings seem to be at odds here.

Should `max topics per day` apply also to message “topics”? If so, then what does `max personal messages per day` do? If not… bug?

---

<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: [November 1, 2020, 5:54pm UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/2 "2020-11-01T17:54:53Z")

</div>

It does sound like a bug. Can we reproduce this next week @tshenry ?

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [November 4, 2020, 12:50am UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/4 "2020-11-04T00:50:59Z")

</div>

I think I can see the problem in the code itself:

> <https://github.com/discourse/discourse/blob/2bb7676ba4f53e0792890224ac9ba580cfe0af79/app/models/topic.rb#L442-L454>

`limit_private_messages_per_day` is checking that the topic is a PM, whereas `limit_topics_per_day` doesn’t check to see if it’s a regular (non-PM) topic.

I think it’s just a matter of adding `return unless regular?` to the top of `limit_topics_per_day`.

I’ll see if I can prove this out and get a PR in place by the end of the week!

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [November 5, 2020, 1:06am UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/5 "2020-11-05T01:06:55Z")

</div>

This should be fixed with the following:

[https://github.com/discourse/discourse/pull/11127](https://github.com/discourse/discourse/pull/11127)

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [November 6, 2020, 4:06pm UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/6 "2020-11-06T16:06:05Z")

</div>

Thank you for the fix! 👍

---

<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: [November 6, 2020, 4:56pm UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/7 "2020-11-06T16:56:59Z")

</div>

I agree with all this, but I think we should also add a

`max personal message topics per day`

site setting.. @sam can you assign that next week? Presumably easy. I don’t like the idea of the number of PM topics a user can create per day now being effectively unlimited.

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [November 6, 2020, 6:44pm UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/9 "2020-11-06T18:44:19Z")

</div>

> [@codinghorror](#):
>
> I don’t like the idea of the number of PM topics a user can create per day now being effectively unlimited.

This should be limited through `max_personal_messages_per_day`. It’s possible the setting may need a rename for extra clarity, but as far as I understand, it’s limiting new PM _topics_, not replies. That’s definitely what I intended to check when I created the test that went with the PR.

I don’t believe we have an global max replies per day setting for topics or PMs.

---

<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: [November 6, 2020, 6:44pm UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/10 "2020-11-06T18:44:52Z")

</div>

Aha! Can you check that, and if that’s the case, make sure the description for the site setting copy makes that clear?

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [November 6, 2020, 9:06pm UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/11 "2020-11-06T21:06:29Z")

</div>

Confirmed! The user I was testing with was rate limited on creating new PMs, but not on replying to existing PMs.

Regarding the description copy, the current description of the `max personal messages per day` setting is:

> Maximum number of messages users can create per day.

What do you think about:

> Maximum number of new personal messages users can create per day.

or

> Maximum number of personal messages users can ~~create~~ start per day.

---

<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: [November 7, 2020, 12:44am UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/12 "2020-11-07T00:44:33Z")

</div>

One tweak

> Maximum number of new personal message topics a user can create per day.

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [November 7, 2020, 1:44am UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/13 "2020-11-07T01:44:04Z")

</div>

Description tweaked!

[https://github.com/discourse/discourse/pull/11155](https://github.com/discourse/discourse/pull/11155)

---

<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: [November 7, 2020, 3:09am UTC](https://meta.discourse.org/t/limits-on-personal-messages-vs-topics/168930/14 "2020-11-07T03:09:57Z")

</div>


