Closed DaveEshopGuide closed 6 months ago
Thanks for flagging this, and digging into the root cause!
If you want to put up a PR to resolve this the team would definitely review to get this out quickly. Otherwise we will look into fixing this in the near future.
@lizkenyon Have a Commit ready, but no permissions to push a branch it seems.
@DaveEshopGuide You will need to create a fork of the repo, and then create a PR. Thanks so much!
@lizkenyon PR created.
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.Also referenced here: https://github.com/Shopify/shopify_app/issues/1830