Block webhook from non subscribers
My request time has surged a lot lately and it is mostly triggered by webhooks being processed. However, more than half of my app users aren't subscribed to a plan and their webhooks are being processed for no use basically, as the app is not functional for them. Currently I have a simple conditional block that calls the mantle api to check if a store is subscribed and return if they aren't but is there a way like shopify webhook filtering to entirely eliminate them?
11 Replies
Hello,
Have you looked at disabling webhooks for users in the install and reinstall actions? Here are some docs: https://docs.gadget.dev/guides/plugins/shopify/shopify-webhooks#disable-webhook-processing-per-shop
does this work for conditionally registered webhooks too? So I moved my app functionality from a model action to a global action triggered by a webhook. What to do about it?
That wouldn't work for global action webhook handling. That only works from models managed by Gadget. Let me talk to the team to see if the workaround I have in mind would work
Actually, it looks like disabledWebhooks should also disable global action webhook handling
For disabling product webhooks use:
For example ^
oh so for instance I disable webhooks for shopifyOrder would that disable it for all order topics such as orders/create, orders/fulfill? or is there a way to filter those too?
Thats correct. There's no way to go further in to disable specific topics at the moment
okay this works just as well thanks
I tried updating the webhook subscription and got the following error:
Error processing subscription cancellation: [GraphQL] Variable "$shopifyShop" got invalid value { disabledWebhooks: { shopifyCheckout: true, shopifyOrder: true } }; Field "disabledWebhooks" is not defined by type "UpdateShopifyShopInput".
route: /subscriptionCancelled
and it isnt available in my api docs either
Use the internal api to update disabledWebhookw
works like a charm thanks:)
petition for ljspoor to be a gadget emloyee
okay so this is just disabling webhooks for orders/create, orders/fulfilled and orders/cancelled are being firec and processed normally
testing with different models for shopifyFulfillments and shopifyFulfillments events etc to see if something works
alright so i tried playing around with this and something has messed up but my webhooks are stuck at registering, tried installing and reinstalling but nope nothing changes, it is stuck here and wont fire the wbehooks either:

stuck here too sync wasnt working either and had to abort it:

none of the wbehooks are firing pls help
okay no i am recieving the webhooks but the webhooks are still stuck registering on my end
this is really confusing, i have removed the logic to disable webhooks since it is causing unnecessary complication
but yet there is some cionfusion