From bd368cef0a1fe7f197d8db02d5cd808b80257e33 Mon Sep 17 00:00:00 2001 From: Andy Liu Date: Wed, 30 Oct 2024 13:09:59 -0400 Subject: [PATCH] remove unused comments and temporary bypass that made unit tests pass --- lib/shopify_api/webhooks/registry.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/shopify_api/webhooks/registry.rb b/lib/shopify_api/webhooks/registry.rb index d58530848..df8ebb1bf 100644 --- a/lib/shopify_api/webhooks/registry.rb +++ b/lib/shopify_api/webhooks/registry.rb @@ -221,18 +221,8 @@ def webhook_registration_needed?(client, registration) "Failed to check if webhook was already registered" unless check_response.ok? parsed_check_result = registration.parse_check_result(T.cast(check_response.body, T::Hash[String, T.untyped])) + must_register = parsed_check_result[:current_address] != registration.callback_address - # update this to check for more than just the current address - # must_register = parsed_check_result[:current_address] != registration.callback_address - - must_register = true # TODO: remove and make a real check - - # any subscription arg (depends on what kind of registration i.e. pubsub, http, eventbridge) has changed - # all 3 have these fields: callbackUrl, subscriptionArgs (which includes includeFields, metafieldNamespaces) - # but the structure of subscriptionArgs is different for each type of registration - # - - # webhook_id is nil if the webhook is not registered. This leads to a create mutation instead of an update { webhook_id: parsed_check_result[:webhook_id], must_register: must_register } end