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
Cannot subscribe to a webhook after unregistering to it #1222
Comments
Hi there 👋 Thank you for flagging this! |
No, the error persists. I now have a question for you. Which is the best way to re-subscribe to a webhook? |
Hi there thanks for flagging👋 Could you confirm what version of the |
Hi there, I get these errors using the I'm testing this using the rails console ❗ |
Hi there 👋 I am unable to replicate this issue. I am able to destroy my webhook subscriptions, call If this is still an issue for you could you please provide an example minimal repository that I am able to clone and run that is able to replicate the issue |
Hi @lizkenyon ! Calling
To reproduce this issue:
Shop.first.with_shopify_session do
ShopifyApp::WebhooksManager.recreate_webhooks!(session: ShopifyAPI::Context.active_session)
end
|
Same issue here |
Hi there 👋 You are getting this error because the You will need to set the SHOPIFY_API_KEY="fake" SHOPIFY_API_SECRET="otherfake" HOST="fa-dual-ict-our.example.com" rails console If you are using the rails console a lot you may want to look into setting up an .env file to hold the variables. |
This method recreates all the webhook subscriptions correctly: def subscribe_to_webhooks
ShopifyApp::WebhooksManager.add_registrations
ShopifyAPI::Webhooks::Registry.register_all(session: ShopifyAPI::Context.active_session)
end |
Issue summary
I'm trying to register to a webhook (
customers/create
) after unregistering to it.These are my webhooks on the
ShopifyApp.configuration
:Here's the code to give you more context:
If I call the
recreate_webhooks!
method from the ShopifyApp, I don't get any errors but If I query thewebhooksSubscription
I get an empty array (the method just deletes my webhooks subscriptions without re-creating them)If I call the
create_webhooks
method from the ShopifyApp, I get this Sorbet error:/Users/jack/.rvm/gems/ruby-3.1.2/gems/sorbet-runtime-0.5.11001/lib/types/_types.rb:222:in
must': Passednil
into T.must (TypeError)`I get the same error if I call:
as the example
here
I think the problem is here since I've tried to manually instantiate a
Registrations::Http
object (since my webhooks havehttp
asdelivery_method
) and it works. The problem might be theregistry
instance variable.Obviously I pass a session that is not nil!
shopify_api
gem version: 13.1.0shopify_app
gem version: 21.6.0Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: