# Chat retention days issue

**URL:** https://meta.discourse.org/t/chat-retention-days-issue/248477
**Category:** UX
**Tags:** chat
**Created:** [December 10, 2022, 12:44pm UTC](https://meta.discourse.org/t/chat-retention-days-issue/248477 "2022-12-10T12:44:49Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [December 10, 2022, 12:44pm UTC](https://meta.discourse.org/t/chat-retention-days-issue/248477/1 "2022-12-10T12:44:49Z")

</div>

Hello,

I noticed 2 issues with chat retention days.

1. There are separate settings to set up `chat channel retention days` and `chat dm retention days`. But it seems it use the `chat channel retention days` value on personal message settings page too.

I setted up 2 different retention day.

 ![Screenshot 2022-12-10 at 13.17.10](https://global.discourse-cdn.com/meta/original/4X/2/2/7/227b133afd2fb2304cdac1eb5bce03848c159ead.png)

 ![personal chat settings](https://global.discourse-cdn.com/meta/original/4X/e/a/7/ea7108682bd57dbfe5a42a98733f9c3f5824ca28.png) ![chat channel settings](https://global.discourse-cdn.com/meta/original/4X/d/0/c/d0cd3d56a7d04e36293bcc79b4ad8d6378c05761.png)

The chat retention reminders in messages show the correct value.

 ![personal chat](https://global.discourse-cdn.com/meta/original/4X/9/4/c/94c45a40c79800b9d0bc9a97934a43cec734d052.png)  
 ![chat channel](https://global.discourse-cdn.com/meta/original/4X/2/2/e/22e634d196d1ab835990e800af81cf2792e8f4d3.png)

* * *

2. When the `chat channel retention days` and/or `chat dm retention days` set to `0` it means retain messages forever. But now on (channel / personal) retention day messages it seems like it saved for `0` day.

 ![chat channel settings](https://global.discourse-cdn.com/meta/original/4X/a/c/8/ac8588bc2eeeecf50980da5940072188bb5b65f0.png)

![chat channel message](https://global.discourse-cdn.com/meta/original/4X/0/6/3/0639fea0813c1a640ca1ead10e63e69cfc19cc90.png)

Thank you 🙂

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [January 14, 2023, 12:42pm UTC](https://meta.discourse.org/t/chat-retention-days-issue/248477/2 "2023-01-14T12:42:07Z")

</div>

Also reported in [Setting chat retention to 0 (indefinite) displays ‘Chat history will be saved for 0 days’](https://meta.discourse.org/t/setting-chat-retention-to-0-indefinite-displays-chat-history-will-be-saved-for-0-days/251527)

> [@Setting chat retention to 0 (indefinite) displays ‘Chat history will be saved for 0 days’](https://meta.discourse.org/t/setting-chat-retention-to-0-indefinite-displays-chat-history-will-be-saved-for-0-days/251527/2):
>
> Let’s see if we can get that tidied up. 👍 🙂

---

<div class="post-metadata">

### Author: ![piffy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/piffy/32/254198_2.png) [@piffy](https://meta.discourse.org/u/piffy)
#### Post date: [February 9, 2023, 5:36am UTC](https://meta.discourse.org/t/chat-retention-days-issue/248477/3 "2023-02-09T05:36:34Z")

</div>

Noticed this today where chat history is indefinite

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/c/d/2cd3e50f0cb4fb489d3da2971a0ea3b52262781a.png)  
`Chat history will be saved for 0 days. `

Maybe for 0, just hide that text entirely?

---

<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: [February 14, 2023, 10:56pm UTC](https://meta.discourse.org/t/chat-retention-days-issue/248477/4 "2023-02-14T22:56:36Z")

</div>

This is all valid reports, thanks 👍

I have fixed this in a local branch, but I need to check something before I push it hopefully tomorrow.

---

<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: [February 15, 2023, 1:50pm UTC](https://meta.discourse.org/t/chat-retention-days-issue/248477/5 "2023-02-15T13:50:51Z")

</div>

That should fix it, let me know how it goes for you:

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

Thanks for the report @Don, good catch 👍

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [February 15, 2023, 5:09pm UTC](https://meta.discourse.org/t/chat-retention-days-issue/248477/6 "2023-02-15T17:09:15Z")

</div>

Hello @j.jaffeux,

Thanks for the fix. This is works extremely well now.

Let’s see the same process like the OP to compare it. 🙂

> [@Don](#):
>
> 1. There are separate settings to set up `chat channel retention days` and `chat dm retention days`. ~~But it seems it use the `chat channel retention days` value on personal message settings page too.~~ Now it shows the correct value everywhere!
> 
> I setted up 2 different retention day.

 ![Screenshot 2023-02-15 at 17.55.48](https://global.discourse-cdn.com/meta/original/4X/a/9/c/a9c349ad4aced479fff9669b81a329bd21448fc2.png)

 ![Screenshot 2023-02-15 at 17.56.34](https://global.discourse-cdn.com/meta/original/4X/7/0/b/70bfa155eb35f74daaff8fb877894ec04d7bfc69.png) ![Screenshot 2023-02-15 at 17.57.08](https://global.discourse-cdn.com/meta/original/4X/5/f/c/5fc9bf93108c6590c605a7ca9f0c24cb507d3e98.png)

> [@Don](#):
>
> 1. When the `chat channel retention days` and/or `chat dm retention days` set to `0` it means retain messages forever. ~~But now on (channel / personal) retention day messages it seems like it saved for `0` day.~~ Now it detects correctly if the value is `0`.

 ![Screenshot 2023-02-15 at 17.59.45](https://global.discourse-cdn.com/meta/original/4X/d/6/b/d6bea1570a961010e24d85d278195ce9668e1817.png)  
 ![Screenshot 2023-02-15 at 17.59.31](https://global.discourse-cdn.com/meta/original/4X/b/5/f/b5f89a68143f4d882eaf9db99bb19924433dbe49.png)

* * *

Thanks again! 🙂

---

<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: [February 16, 2023, 12:13am UTC](https://meta.discourse.org/t/chat-retention-days-issue/248477/7 "2023-02-16T00:13:17Z")

</div>

Perfect, thanks for checking, very much appreciated 🙌

---

<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: [February 20, 2023, 7:00am UTC](https://meta.discourse.org/t/chat-retention-days-issue/248477/8 "2023-02-20T07:00:44Z")

</div>

This topic was automatically closed after 4 days. New replies are no longer allowed.
