diff --git a/CHANGELOG.md b/CHANGELOG.md index b77d2720a..f2708a2c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ Unreleased ---------- +- [Patch] Fix sorbet errors in generated webhook handlers 23.0.1 (December 22, 2025) - Fix engine initialization [#2040](https://github.com/Shopify/shopify_app/pull/2040) diff --git a/lib/generators/shopify_app/add_app_uninstalled_job/templates/app_uninstalled_job.rb.tt b/lib/generators/shopify_app/add_app_uninstalled_job/templates/app_uninstalled_job.rb.tt index a441d2523..c60e7a444 100644 --- a/lib/generators/shopify_app/add_app_uninstalled_job/templates/app_uninstalled_job.rb.tt +++ b/lib/generators/shopify_app/add_app_uninstalled_job/templates/app_uninstalled_job.rb.tt @@ -1,10 +1,8 @@ class AppUninstalledJob < ActiveJob::Base - include ShopifyAPI::Webhooks::WebhookHandler + extend ShopifyAPI::Webhooks::WebhookHandler - class << self - def handle(topic:, shop:, body:, webhook_id:, api_version:) - perform_later(topic: topic, shop_domain: shop, webhook: body) - end + def self.handle(topic:, shop:, body:, webhook_id:, api_version:) + perform_later(topic: topic, shop_domain: shop, webhook: body) end def perform(topic:, shop_domain:, webhook:) diff --git a/lib/generators/shopify_app/add_privacy_jobs/templates/customers_data_request_job.rb.tt b/lib/generators/shopify_app/add_privacy_jobs/templates/customers_data_request_job.rb.tt index 0aba51f74..aa98a1eff 100644 --- a/lib/generators/shopify_app/add_privacy_jobs/templates/customers_data_request_job.rb.tt +++ b/lib/generators/shopify_app/add_privacy_jobs/templates/customers_data_request_job.rb.tt @@ -1,10 +1,8 @@ class CustomersDataRequestJob < ActiveJob::Base - include ShopifyAPI::Webhooks::WebhookHandler + extend ShopifyAPI::Webhooks::WebhookHandler - class << self - def handle(topic:, shop:, body:, webhook_id:, api_version:) - perform_later(topic: topic, shop_domain: shop, webhook: body) - end + def self.handle(topic:, shop:, body:, webhook_id:, api_version:) + perform_later(topic: topic, shop_domain: shop, webhook: body) end def perform(topic:, shop_domain:, webhook:) diff --git a/lib/generators/shopify_app/add_privacy_jobs/templates/customers_redact_job.rb.tt b/lib/generators/shopify_app/add_privacy_jobs/templates/customers_redact_job.rb.tt index 4de29ba2f..9dc0a1716 100644 --- a/lib/generators/shopify_app/add_privacy_jobs/templates/customers_redact_job.rb.tt +++ b/lib/generators/shopify_app/add_privacy_jobs/templates/customers_redact_job.rb.tt @@ -1,10 +1,8 @@ class CustomersRedactJob < ActiveJob::Base - include ShopifyAPI::Webhooks::WebhookHandler + extend ShopifyAPI::Webhooks::WebhookHandler - class << self - def handle(topic:, shop:, body:, webhook_id:, api_version:) - perform_later(topic: topic, shop_domain: shop, webhook: body) - end + def self.handle(topic:, shop:, body:, webhook_id:, api_version:) + perform_later(topic: topic, shop_domain: shop, webhook: body) end def perform(topic:, shop_domain:, webhook:) diff --git a/lib/generators/shopify_app/add_privacy_jobs/templates/shop_redact_job.rb.tt b/lib/generators/shopify_app/add_privacy_jobs/templates/shop_redact_job.rb.tt index a23e98490..f2c5b83de 100644 --- a/lib/generators/shopify_app/add_privacy_jobs/templates/shop_redact_job.rb.tt +++ b/lib/generators/shopify_app/add_privacy_jobs/templates/shop_redact_job.rb.tt @@ -1,10 +1,8 @@ class ShopRedactJob < ActiveJob::Base - include ShopifyAPI::Webhooks::WebhookHandler + extend ShopifyAPI::Webhooks::WebhookHandler - class << self - def handle(topic:, shop:, body:, webhook_id:, api_version:) - perform_later(topic: topic, shop_domain: shop, webhook: body) - end + def self.handle(topic:, shop:, body:, webhook_id:, api_version:) + perform_later(topic: topic, shop_domain: shop, webhook: body) end def perform(topic:, shop_domain:, webhook:) diff --git a/lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt b/lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt index 3a377f62f..09b3dc6a8 100644 --- a/lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt +++ b/lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt @@ -1,10 +1,8 @@ class <%= @job_class_name %> < ActiveJob::Base - include ShopifyAPI::Webhooks::WebhookHandler + extend ShopifyAPI::Webhooks::WebhookHandler - class << self - def handle(topic:, shop:, body:, webhook_id:, api_version:) - perform_later(topic: topic, shop_domain: shop, webhook: body) - end + def self.handle(topic:, shop:, body:, webhook_id:, api_version:) + perform_later(topic: topic, shop_domain: shop, webhook: body) end def perform(topic:, shop_domain:, webhook:)