Shopify / shopify-api-ruby

ShopifyAPI is a lightweight gem for accessing the Shopify admin REST and GraphQL web services.
MIT License
1.06k stars 469 forks source link

ShopifyAPI::Webhooks::Registry doesn't update webhooks if metafield_namespaces has changed #1323

Open fmichaut-diff opened 4 months ago

fmichaut-diff commented 4 months ago

Overview/summary

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 :

lizkenyon commented 4 months ago

Hi there 👋

Thanks for flagging this!

I agree that this is an improvement that we should do. The team will look into this!