Skip to content

Commit c45ff49

Browse files
lizkenyonclaude
authored andcommitted
Fix webhook registration for topics containing dots
Fixes an issue where webhook topics containing dots (e.g., customer.tags_added, customer.tags_removed) would fail to register with GraphQL syntax errors. The problem was an inconsistency in topic name normalization: - Registration.rb only replaced slashes with underscores - Registry.rb replaced both slashes and dots with underscores This caused GraphQL field name errors since dots are invalid in GraphQL field names. Updated the normalization in Registration.rb to match Registry.rb by replacing both slashes and dots with underscores. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e7871ff commit c45ff49

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
Note: For changes to the API, see https://shopify.dev/changelog?filter=api
44
## Unreleased
55

6+
- [#1405](https://github.com/Shopify/shopify-api-ruby/pull/1405) Fix webhook registration for topics containing dots (e.g., `customer.tags_added`, `customer.tags_removed`)
7+
68
## 14.11.1
79

810
- [#1395](https://github.com/Shopify/shopify-api-ruby/pull/1395) use correct internal admin host for 1P app development

lib/shopify_api/webhooks/registration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Registration
3232
filter: T.nilable(String)).void
3333
end
3434
def initialize(topic:, path:, handler: nil, fields: nil, metafield_namespaces: nil, filter: nil)
35-
@topic = T.let(topic.gsub("/", "_").upcase, String)
35+
@topic = T.let(topic.gsub(%r{/|\.}, "_").upcase, String)
3636
@path = path
3737
@handler = handler
3838
fields_array = fields.is_a?(String) ? fields.split(FIELDS_DELIMITER) : fields

0 commit comments

Comments
 (0)