-
Notifications
You must be signed in to change notification settings - Fork 191
Fix: Allow compliance webhooks with legacy install flow #6108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3032 tests passing in 1317 suites. Report generated by 🧪jest coverage report action from 7974965 |
await expect(app.preDeployValidation()).resolves.not.toThrow() | ||
}) | ||
|
||
test('does not throw an error for subscription with only compliance_topics and no topics field', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this test exactly the same as the first one? or am i missing something?
Do we need a patch release for this? |
Hey folks - could this be extended to support other webhooks that don't require scopes? Our Fixed by this PR:
Not fixed by this PR, but don't seem to require additional scopes:
I can open a new issue for this if it's easier. Here's the relevant part of our configuration that was working in CLI version [access_scopes]
scopes = "read_content,write_content,read_customers,write_customers,read_orders,read_all_orders,read_products,write_products,read_price_rules,write_price_rules,read_discounts,write_discounts,write_gift_cards"
use_legacy_install_flow = true
[build]
include_config_on_deploy = true
[auth]
redirect_urls = [
"https://app.example.com/auth/shopify/offline/callback",
"https://app.example.com/auth/shopify/online/callback",
]
[webhooks]
api_version = "2025-01"
[[webhooks.subscriptions]]
uri = "https://example.com/shopify/webhooks/customers/data_request"
compliance_topics = ["customers/data_request"]
[[webhooks.subscriptions]]
uri = "https://example.com/shopify/webhooks/customers/redact"
compliance_topics = ["customers/redact"]
[[webhooks.subscriptions]]
uri = "https://example.com/shopify/webhooks/shop/redact"
compliance_topics = ["shop/redact"]
[[webhooks.subscriptions]]
topics = ["app/uninstalled"]
uri = "https://example.com/shopify/uninstall"
[[webhooks.subscriptions]]
uri = "https://example.com/shopify/webhooks/customer_account_settings/update"
topics = ["customer_account_settings/update"] |
WHY are these changes introduced?
Fixes #6003 regression - After PR #6003, users reported that the CLI incorrectly prevents deployment when using only compliance webhooks with
use_legacy_install_flow = true
.The validation treats ALL webhook subscriptions as app-specific, including compliance topics which are mandatory for public apps and should be allowed with legacy install flow.
User report: https://community.shopify.dev/t/compliance-topics-issue/18702
WHAT is this pull request doing?
This PR fixes the webhook validation logic to properly distinguish between app-specific webhooks and compliance webhooks:
topics
field as app-specificThe fix allows compliance-only webhook configurations to work with legacy install flow, which is necessary because:
compliance_topics
field, not thetopics
fieldHow to test your changes?
use_legacy_install_flow = true
shopify app deploy
- it should now succeedtopics
- deployment should fail as expectedPost-release steps
None required.
Measuring impact
How do we know this change was effective? Please choose one:
Checklist