I am encountering an issue with the ShopifyApp::WebhooksManagerJob when response_as_struct is set to true in the ShopifyAPI::Context.setup configuration.
Expected behavior
Webhooks registry should adapt to the response_as_struct setting and not throw an error.
Actual behavior
Webhooks registry throws an error on running the WebhooksManager
Steps to reproduce the problem
Set response_as_struct to true in Shopify App Context
Have one or more webhooks configured
Install app triggering the execution of the WebhooksManager
Debug logs
class=ShopifyApp::WebhooksManagerJob jid=5f9296991f0ea1d916d3c55c ERROR: Error performing ShopifyApp::WebhooksManagerJob (Job ID: d541fd80-49ba-48aa-9cf7-adc575680edd) from Sidekiq(default) in 544.34ms: TypeError (T.cast: Expected type T::Hash[String, T.untyped], got type OpenStruct
This line
parsed_check_result = registration.parse_check_result(T.cast(check_response.body, T::Hash[String, T.untyped]))
should only expect T::Hash[String, T.untyped] if response_as_struct is false.
This should be fixed in the shopify_api repo, but for reference i also created this issue here since it happens with the shopify_app and shopify_api gems interacting
Issue summary
Hello,
I am encountering an issue with the
ShopifyApp::WebhooksManagerJob
whenresponse_as_struct
is set to true in theShopifyAPI::Context.setup
configuration.Expected behavior
Webhooks registry should adapt to the response_as_struct setting and not throw an error.
Actual behavior
Webhooks registry throws an error on running the WebhooksManager
Steps to reproduce the problem
Debug logs
class=ShopifyApp::WebhooksManagerJob jid=5f9296991f0ea1d916d3c55c ERROR: Error performing ShopifyApp::WebhooksManagerJob (Job ID: d541fd80-49ba-48aa-9cf7-adc575680edd) from Sidekiq(default) in 544.34ms: TypeError (T.cast: Expected type T::Hash[String, T.untyped], got type OpenStruct
This line
parsed_check_result = registration.parse_check_result(T.cast(check_response.body, T::Hash[String, T.untyped]))
should only expect T::Hash[String, T.untyped] if response_as_struct is false.