Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShopifyApp::WebhooksManager support for event_bridge and pub_sub #1649

Closed
kgorshkov opened this issue Feb 19, 2023 · 2 comments
Closed

ShopifyApp::WebhooksManager support for event_bridge and pub_sub #1649

kgorshkov opened this issue Feb 19, 2023 · 2 comments

Comments

@kgorshkov
Copy link

kgorshkov commented Feb 19, 2023

Issue summary

Previously the address field was available to be set in \initializers\shopify_app.rb

ShopifyApp.configure do |config|
  config.webhooks = [
    {topic: 'carts/update', path: 'webhooks/carts_update', address: 'EVENT_BRIDGE_ARN_ADDRESS', format: 'json'}
  ]
end

ShopifyApp::WebhooksManager no longer expects the :address in the initializer, and it seems that the reason is that it now only supports :http and does not support :event_bridge, and :pub_sub since the address set is the http ENV['HOST']

ShopifyApp.configure do |config|
  config.webhooks = [
    {topic: 'carts/update', path: 'webhooks/carts_update'}
  ]
end

The resulting webhook registration looks like this:

<ShopifyAPI::Webhook:0x000002a1bef6bff0
@address="ENV['HOST']/webhooks/shop_update",
@aliased_properties={},
@api_version="2023-01",

Looks like it is not possible to set an :event_bridge or :pub_sub address in the initializer and the webhook is registered as http. I am only able to set or update the address directly such as with the REST API:

webhook = ShopifyAPI::Webhook.new(session: session)
webhook.address = Rails.configuration.aws_partner_event_source_arn
webhook.topic = topic
webhook.format = 'json'
webhook.save!
  • shopify_api version: 12.4.0
  • shopify_app version: 21.4.0
  • Ruby version: 3.2.1

Expected behavior

ShopifyApp::WebhooksManager supports :http, :event_bridge, and :pub_sub address types in the initializer

Actual behavior

ShopifyApp::WebhooksManager only supports :http webhook address types and it seems that along with WebhooksController it is now designed specifically for http webhooks.

@wowremywang
Copy link

@kgorshkov, there is #1635 to fix this.

@kgorshkov
Copy link
Author

@maxwang096 thanks for pointing that out, I searched the Issues before posting, but I guess I used the wrong search terms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants