# "composer was opened without a draft key"

**URL:** https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851
**Category:** Bug
**Created:** [2017年十二月28日 00:45 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851 "2017-12-28T00:45:02Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![8BIT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/8bit/32/76872_2.png) [@8BIT](https://meta.discourse.org/u/8BIT)
#### Post date: [2017年十二月28日 00:45 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851/1 "2017-12-28T00:45:02Z")

</div>

![IMG_1017](https://global.discourse-cdn.com/meta/original/3X/6/d/6dd3c023ef4eb591b7ed7baa858b01ad32517f4e.jpg)

this came up a few times, but, was unable to get it to do it on purpose. only thing consistent was that i was on mobile. i have the latest update(s).

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2017年十二月28日 00:45 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851/2 "2017-12-28T00:45:37Z")

</div>

Does it happen in [safe mode](https://meta.discourse.org/t/53504?silent=true) on that site?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2017年十二月28日 01:31 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851/3 "2017-12-28T01:31:14Z")

</div>

I have also had reports of this error on my site sporadically for the last few months. I’ve been unable to track down the cause or any way to reproduce it myself. Apparently it occurs on iOS when clicking the new topic button.

I realise that’s not particularly helpful, but maybe it rules out any specific customisations @8BIT has in place.

---

<div class="post-metadata">

### Author: ![8BIT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/8bit/32/76872_2.png) [@8BIT](https://meta.discourse.org/u/8BIT)
#### Post date: [2017年十二月28日 02:25 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851/4 "2017-12-28T02:25:27Z")

</div>

i can’t seem to replicate it consistently enough, but, i do not think so…

---

<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: [2017年十二月28日 02:46 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851/5 "2017-12-28T02:46:35Z")

</div>

This is your alert @sam any diagnostic ideas?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2018年二月5日 21:21 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851/6 "2018-02-05T21:21:48Z")

</div>

I’ve managed to reproduce this consistently on mobile

1. Visit `https://meta.discourse.org/categories`, refresh the page
2. Navigate to Latest
3. Click New Topic
4. Error occurs

Navigating to another page resolves the issue. Here’s a video of the process:

[https://global.discourse-cdn.com/meta/original/3X/1/f/1f39da00a71b36e6e4f22bcc3983f6be3d1b6a19.MP4](https://global.discourse-cdn.com/meta/original/3X/1/f/1f39da00a71b36e6e4f22bcc3983f6be3d1b6a19.MP4)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2018年二月5日 21:37 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851/7 "2018-02-05T21:37:17Z")

</div>

既然我们已经有了清晰的复现步骤，现在将其标记为 #Contribute > Bug 并欢迎 #pr-welcome。

---

<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: [2018年二月5日 21:39 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851/9 "2018-02-05T21:39:15Z")

</div>

I will take it as Im currently facing the same kind of bug with the new reply select kit component, and Im digging through this code.

---

<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: [2018年二月6日 13:49 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851/10 "2018-02-06T13:49:05Z")

</div>

So this is coming from here:

[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/routes/discovery-categories.js.es6#L15](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/routes/discovery-categories.js.es6#L15)

`const style = !this.site.mobileView && this.siteSettings.desktop_category_page_style;`

So on mobile we are calling `promise = CategoryList.listForParent(this.store, parentCategory);` while on desktop we are calling `promise = this._loadCategoriesAndLatestTopics();` which is effectively setting the draft\_key: [https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/routes/discovery-categories.js.es6#L49](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/routes/discovery-categories.js.es6#L49)

I went with this easy fix:

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

As I didn’t want to refactor the whole `discovery-categories` file, do you think that should be enough @sam ?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2018年二月6日 13:55 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851/11 "2018-02-06T13:55:11Z")

</div>

Seems fine to me, very safe change.

---

<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: [2018年二月7日 17:00 UTC](https://meta.discourse.org/t/composer-was-opened-without-a-draft-key/76851/12 "2018-02-07T17:00:49Z")

</div>

This topic was automatically closed after 24 hours. New replies are no longer allowed.
