# 临时关闭的主题中消息键不正确

**URL:** https://meta.discourse.org/t/incorrect-message-key-in-temporarily-closed-topic/87773
**Category:** Bug
**Created:** [2018年五月17日 20:17 UTC](https://meta.discourse.org/t/incorrect-message-key-in-temporarily-closed-topic/87773 "2018-05-17T20:17:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [2018年五月17日 20:17 UTC](https://meta.discourse.org/t/incorrect-message-key-in-temporarily-closed-topic/87773/1 "2018-05-17T20:17:56Z")

</div>

Temporarily closing a topic in a category set to ‘Close X hours after last post’ leads to an incorrect message key:

Reproduction steps:

have category with auto-close-based-on-last-post settings such as:

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

create topic:

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/b/5bf272e90870a36742cee54d8e20996c94ce4a2b.png)

close topic temporarily:

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

result:

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

It’s picking up the fact that the topic closing time is `based_on_last_post` but applying it to the `auto_open` state, which is incorrect.

* * *

Another path that leads to this result:

- close topic
- set auto-reopen

This problem seems due to client confusion. I never got a 502 error but there definitely is some weirdness coming here from the client, e.g. this `timers` XHR call:

```plaintext
based_on_last_post:true
category_id:null
closed:true
duration:2018
execute_at:"2018-08-09T16:16:14.873Z"
success:"OK"

```

3 months in the future? 😕

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [2018年五月18日 08:34 UTC](https://meta.discourse.org/t/incorrect-message-key-in-temporarily-closed-topic/87773/4 "2018-05-18T08:34:01Z")

</div>

Fixed in

[https://github.com/discourse/discourse/commit/2fecb4b46e7fea0e2e3cb2adbbfe83b6a77f1a23](https://github.com/discourse/discourse/commit/2fecb4b46e7fea0e2e3cb2adbbfe83b6a77f1a23)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [2018年五月18日 08:34 UTC](https://meta.discourse.org/t/incorrect-message-key-in-temporarily-closed-topic/87773/5 "2018-05-18T08:34:03Z")

</div>


