ShopifyAPI::Webhooks::Registry#webhook_registration_needed? only checks that the address of the webhook is the same.
If anything else changed (metafield_namespaces, fields, private_metafield_namespaces, format) the webhook will be considered up to date and will be skipped.
The (Graphql and Rest) API supports update operations on Webhooks, so it should be trivial for the ShopifyAPI::Webhooks::Registry to implement updates for existing webhooks.
Basically the behaviour should be as follow :
No webhook existing for that address + topic ? -> create it
If webhook exist, check if other parameters (fields, metafields, ...) are up to date. If not -> update it
Otherwise all is good, we don't have to do anything
Overview/summary
ShopifyAPI::Webhooks::Registry#webhook_registration_needed?
only checks that theaddress
of the webhook is the same. If anything else changed (metafield_namespaces, fields, private_metafield_namespaces, format) the webhook will be considered up to date and will be skipped.The (Graphql and Rest) API supports
update
operations on Webhooks, so it should be trivial for theShopifyAPI::Webhooks::Registry
to implement updates for existing webhooks.Basically the behaviour should be as follow :