# Reply on Original Topic - undefined

**URL:** https://meta.discourse.org/t/reply-on-original-topic-undefined/146300
**Category:** Bug
**Created:** [March 31, 2020, 3:33pm UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300 "2020-03-31T15:33:28Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [March 31, 2020, 3:33pm UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/1 "2020-03-31T15:33:28Z")

</div>

Hi,  
I don’t know what I did exactly. I was replying a direct message while browsing some topics, and when I wanted to submit the message I had this popup:

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

It’s the first time I’ve seen it, and I’m puzzled with the “undefined”. I guess a more user-friendly message would be better. I don’t know if the undefined is a bug, a deleted topic or something else.

Also, which context this popup appears in exactly? 🤔

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 31, 2020, 4:08pm UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/2 "2020-03-31T16:08:18Z")

</div>

My guess is that the original topic got deleted?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [March 31, 2020, 4:14pm UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/3 "2020-03-31T16:14:29Z")

</div>

I’m puzzled. I don’t know which topic the undefined part is about, and I believe I started my message on the direct discussion page.

This is confusing. Also, I’ve written many messages on various Discourse forums and I didn’t get this popup once (which adds to the confusion), hence what I’m also asking the exact context it appears in.

As for the message itself, I’d prefer “topic not found” to “undefined”. 🙂

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [March 31, 2020, 5:31pm UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/4 "2020-03-31T17:31:32Z")

</div>

> [@Canapin](#):
>
> I was replying a direct message while browsing some topics, and when I wanted to submit the message I had this popup:

I just ran into the same problem on Meta when I had the composer open in two tabs. Attempting to reply to the topic, the popup from your screenshot was displayed. That popup window is expected to be displayed, but underneath the heading, the original topic’s title should be displayed. It seems that Discourse is not finding the original topic.

 ![reply_undefined](https://global.discourse-cdn.com/meta/original/3X/5/0/50e1acf0a38c5228450a4c95f71609be2974708b.png)

When I clicked the Reply on Original Topic option, the following error was displayed:

 ![reply_undefined_two](https://global.discourse-cdn.com/meta/original/3X/9/2/92242715280faaf452e2c1853ed207fe41a891e7.png)

This seems like a bug. Unless someone knows what is causing the problem, we’ll have to work out the steps to reproduce the issue. I’ll get a chance to do that today.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [March 31, 2020, 6:49pm UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/5 "2020-03-31T18:49:12Z")

</div>

I can reproduce the issue on [https://try.discourse.org/](https://try.discourse.org/).

Steps to reproduce (tested with the Chrome browser on Linux):

- browse to a topic and click the reply button to open the composer
- start creating a reply
- duplicate the tab
- click the composer’s reply button from the duplicated tab ![image](https://global.discourse-cdn.com/meta/original/3X/9/6/9609172df9501b7d9d24624b977d186209dc20c1.png)

---

<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: [April 1, 2020, 3:24am UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/9 "2020-04-01T03:24:47Z")

</div>

Honestly, no idea how the ever worked, we still need a massive rewrite on composer model and controller, but at least now stuff is correctly loading and not relying on luck like it used to.

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

---

<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: [April 1, 2020, 11:56pm UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/10 "2020-04-01T23:56:21Z")

</div>



---

<div class="post-metadata">

### Author: ![daniel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel/32/172786_2.png) [@daniel](https://meta.discourse.org/u/daniel)
#### Post date: [April 3, 2020, 1:42pm UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/11 "2020-04-03T13:42:39Z")

</div>



---

<div class="post-metadata">

### Author: ![daniel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel/32/172786_2.png) [@daniel](https://meta.discourse.org/u/daniel)
#### Post date: [April 3, 2020, 1:43pm UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/12 "2020-04-03T13:43:05Z")

</div>

This is still happening. I don’t have steps to reproduce it, but I experienced it today.

---

<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: [April 4, 2020, 8:38am UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/13 "2020-04-04T08:38:47Z")

</div>

OK, but without a repro, what exactly can we do?

---

<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: [April 4, 2020, 10:08am UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/14 "2020-04-04T10:08:53Z")

</div>

So I got a repro by following these steps:

- browse to a topic and click the reply button to open the composer
- start creating a reply
- duplicate the tab (you can do this by right clicking on a tab)  
---- NEW STEPS
- click on forum logo
- click on a other topic
- composer should show with your previous reply
- click the composer’s reply button (at this step you should still be on the duplicated tab)

You should see something like this:

 ![Screenshot 2020-04-04 at 12.07.14](https://global.discourse-cdn.com/meta/original/3X/f/8/f8299b83bce5477999f9d13f768f6e60dbda6973.png)

---

<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: [April 6, 2020, 6:31am UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/16 "2020-04-06T06:31:22Z")

</div>

This should fix it:

[https://review.discourse.org/t/fix-when-loading-drafts-set-the-topic/10372](https://review.discourse.org/t/fix-when-loading-drafts-set-the-topic/10372)

This code is all pretty fragile and very complex to test.

---

<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: [April 6, 2020, 6:31am UTC](https://meta.discourse.org/t/reply-on-original-topic-undefined/146300/17 "2020-04-06T06:31:36Z")

</div>


