Skip to content

Commit

Permalink
Skip handler for non http webhooks
Browse files Browse the repository at this point in the history
This fixes registration for :event_bridge and :pub_sub webhooks.
  • Loading branch information
kirillplatonov committed Jan 6, 2023
1 parent 97b6d21 commit ebd73da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Unreleased
----------

* Fix registration of event_bridge and pub_sub webhooks [#1635](https://github.com/Shopify/shopify_app/pull/1635)

21.4.0 (Jan 5, 2023)
----------
* Updated shopify_api to 12.4.0 [#1633](https://github.com/Shopify/shopify_app/pull/1633)
Expand Down
5 changes: 3 additions & 2 deletions lib/shopify_app/managers/webhooks_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ def add_registrations
ShopifyApp::Logger.debug("Adding registrations to webhooks")
ShopifyApp.configuration.webhooks.each do |attributes|
webhook_path = path(attributes)
delivery_method = attributes[:delivery_method] || :http

ShopifyAPI::Webhooks::Registry.add_registration(
topic: attributes[:topic],
delivery_method: attributes[:delivery_method] || :http,
delivery_method: delivery_method,
path: webhook_path,
handler: webhook_job_klass(webhook_path),
handler: delivery_method == :http ? webhook_job_klass(webhook_path) : nil,
fields: attributes[:fields],
)
end
Expand Down

0 comments on commit ebd73da

Please sign in to comment.