# WebHookEventType and the solved and assign plugins

**URL:** https://meta.discourse.org/t/webhookeventtype-and-the-solved-and-assign-plugins/144180
**Category:** Bug
**Created:** [March 13, 2020, 8:32am UTC](https://meta.discourse.org/t/webhookeventtype-and-the-solved-and-assign-plugins/144180 "2020-03-13T08:32:53Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 13, 2020, 8:32am UTC](https://meta.discourse.org/t/webhookeventtype-and-the-solved-and-assign-plugins/144180/1 "2020-03-13T08:32:54Z")

</div>

In [this](https://github.com/discourse/discourse-solved/commit/8d883fba938528492815b1d015b85bcf5e83b47d) (fantastic) change that added webhooks to the solved plugin, [some functionality regarding the webhook event types](https://github.com/discourse/discourse/pull/9110/commits/af0822f590cb8aee009929dd4963fc62060a17ed) was moved to core.

However, this has some unwanted side effects.

1. on instances that do not have the solved or assign plugins installed, the event types are showing but the translation is missing, and (of course) the events are not available although they are being shown.

 ![afbeelding](https://global.discourse-cdn.com/meta/original/3X/c/d/cdbe3b5f44571cfc52b58c0f957dbeedb453a727.png)

1. the solved and assign plugins are currently **broken** on new stable and beta installs because they are missing the [seeds](https://github.com/discourse/discourse/pull/9110/commits/af0822f590cb8aee009929dd4963fc62060a17ed#diff-e5c47cd3f0bb5e2f2e4a7a9d44f80025)

My initial thought was to ask you to backport the seeds to stable to fix #2, but since there is an additional bug (#1) maybe it is better to leave the seeding code in the actual plugin and just [reserve the ID’s](https://github.com/discourse/discourse/pull/9110/commits/af0822f590cb8aee009929dd4963fc62060a17ed#diff-bab59ee31aa4d2c6d6fa4449436e6db0R14-R15) in the code in core.

Long story short, I think it would be better to move the

```
WebHookEventType.seed do |b|
  b.id = WebHookEventType::SOLVED
  b.name = "solved"
end

```

code back into the solved and assign plugins.

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [March 13, 2020, 5:47pm UTC](https://meta.discourse.org/t/webhookeventtype-and-the-solved-and-assign-plugins/144180/2 "2020-03-13T17:47:45Z")

</div>

Thanks for bringing this up. I will look into what we can do so that if the plugins aren’t installed they don’t show up in core.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 13, 2020, 7:24pm UTC](https://meta.discourse.org/t/webhookeventtype-and-the-solved-and-assign-plugins/144180/4 "2020-03-13T19:24:15Z")

</div>

Great, thank you!  
Can you please try to address the fact that it is broken on stable as well?

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [March 17, 2020, 6:31pm UTC](https://meta.discourse.org/t/webhookeventtype-and-the-solved-and-assign-plugins/144180/5 "2020-03-17T18:31:51Z")

</div>

> [@RGJ](#):
>
> 1. on instances that do not have the solved or assign plugins installed, the event types are showing but the translation is missing, and (of course) the events are not available although they are being shown.

A fix has been created for this:

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

Regarding #2 though:

> [@RGJ](#):
>
> 1. the solved and assign plugins are currently **broken** on new stable and beta installs

I’m not seeing any issues running stable (2.4.1) locally with the latest versions of the the discourse-assign and discourse-solved plugins.

Could you provide some info on how I can replicate the issues you are running into?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 17, 2020, 7:10pm UTC](https://meta.discourse.org/t/webhookeventtype-and-the-solved-and-assign-plugins/144180/6 "2020-03-17T19:10:04Z")

</div>

> [@blake](#):
>
> Could you provide some info on how I can replicate the issues you are running into?

A **new** install on stable with the latest version of the solved plugin will not have the ID’s in the `web_hook_event_type` table, preventing the webhook type from showing.

This is happening because the code that seeds the ID’s has been removed from the solved plugin and it is not yet present in the stable / beta release.

Previously installed sites that had an older version of the solved plugin will already have the seed data and they will not have the problem.

So replication step is easy: create a **brand new** install on stable.

Clean **new** install on 2.4.1 with solved plugin: no webhook available.

 ![LKqhCxFVDH](https://global.discourse-cdn.com/meta/original/3X/9/2/92624ab5f59b0c35669f0567911c00bd18e018cd.gif)

Let’s perform the seeding manually, then take a look at the webhook screen again and it will appear:

 ![pX9fvAw4i7](https://global.discourse-cdn.com/meta/original/3X/9/b/9b64f8cfc8795ccf85996caa5f2838bf11746f2f.gif)

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [March 17, 2020, 7:35pm UTC](https://meta.discourse.org/t/webhookeventtype-and-the-solved-and-assign-plugins/144180/7 "2020-03-17T19:35:14Z")

</div>

Oh okay, so “broken” means it just doesn’t show up.

> [@RGJ](#):
>
> Clean **new** install on 2.4.1 with solved plugin: no webhook available.

This is by design. It is a 2.5+ feature.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 17, 2020, 7:40pm UTC](https://meta.discourse.org/t/webhookeventtype-and-the-solved-and-assign-plugins/144180/8 "2020-03-17T19:40:28Z")

</div>

Ok, you are completely right, my apologies for being unclear. I was mixing up ‘broken’ and ‘not available’, and since this is a new feature there is indeed nothing broken.

It does feel a bit strange how seeding code for a plugin is moved into core though. I can understand that you want to reserve the ID’s but I think it would be more clean to leave the seeding in the plugin. But that’s just my own personal opinion 😉

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [March 17, 2020, 9:12pm UTC](https://meta.discourse.org/t/webhookeventtype-and-the-solved-and-assign-plugins/144180/9 "2020-03-17T21:12:48Z")

</div>


