# Post created is fired when topic created

**URL:** https://meta.discourse.org/t/post-created-is-fired-when-topic-created/84725
**Category:** Support
**Created:** [4월 6, 2018, 2:31오후 UTC](https://meta.discourse.org/t/post-created-is-fired-when-topic-created/84725 "2018-04-06T14:31:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jordan1909](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jordan1909](https://meta.discourse.org/u/jordan1909)
#### Post date: [4월 6, 2018, 2:31오후 UTC](https://meta.discourse.org/t/post-created-is-fired-when-topic-created/84725/1 "2018-04-06T14:31:16Z")

</div>

Working with the internal event hooks and I noticed, when the topic\_created event triggers so does post\_created. For the initial topic post, wouldn’t the assumption be that a post was created as well?

Is there a reason why they both would fire at the same time? It seems redundant to have both fire at the same time, especially because you cannot create a topic without an inital post.

Ex:

```ruby
DiscourseEvent.on(:topic_created) do |topic|
    puts "New Topic"
end

DiscourseEvent.on(:post_created) do |post|
   puts "New post"
end

```

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [4월 6, 2018, 6:55오후 UTC](https://meta.discourse.org/t/post-created-is-fired-when-topic-created/84725/2 "2018-04-06T18:55:26Z")

</div>

It is by design. If `post_created` event skipped in topic creations then the code which only listening `post_created` events won’t be executed.

---

<div class="post-metadata">

### Author: ![jordan1909](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jordan1909](https://meta.discourse.org/u/jordan1909)
#### Post date: [4월 6, 2018, 6:58오후 UTC](https://meta.discourse.org/t/post-created-is-fired-when-topic-created/84725/3 "2018-04-06T18:58:52Z")

</div>

Ah that makes sense just seemed odd to me at first glance.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [4월 12, 2018, 4:09오후 UTC](https://meta.discourse.org/t/post-created-is-fired-when-topic-created/84725/4 "2018-04-12T16:09:53Z")

</div>


