Skip to content

[Shopify] Limit webhook subscription payload fields - #11658

Open
Onat Buyukakkus (onbuyuka) wants to merge 1 commit into
mainfrom
bugs/650501-webhook-include-fields
Open

Onat Buyukakkus (onbuyuka) wants to merge 1 commit into
mainfrom
bugs/650501-webhook-include-fields

Conversation

@onbuyuka

@onbuyuka Onat Buyukakkus (onbuyuka) commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What & why

Shopify sends the full webhook resource when includeFields is omitted. The connector uses orders/create only as a synchronization trigger, and the bulk-operation callback only consumes the operation ID and type.

This change adds topic-specific includeFields when creating webhook subscriptions:

  • ORDERS_CREATE: id
  • BULK_OPERATIONS_FINISH: admin_graphql_api_id, type

Linked work

Fixes AB#650501

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • Built the Shopify Connector and Shopify Connector Test apps successfully with the AL MCP build.
  • Published both apps to the local Business Central environment and exercised the existing webhook registration flows.
  • No tests were added because the selected fields are declared directly in the GraphQL resource; existing webhook tests continue to cover subscription creation.

Risk & compatibility

Existing Shopify subscriptions are not modified automatically. The reduced payload applies when a subscription is newly created or recreated. No schema, permission, or upgrade changes are included.

Add topic-specific includeFields when creating Shopify webhook subscriptions so order-created callbacks send only the order ID and bulk-operation callbacks send only the fields consumed by the connector.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 222c9414-c7a8-4bd7-9eb9-0224ae33f4a3
@onbuyuka
Onat Buyukakkus (onbuyuka) requested a review from a team as a code owner September 21, 2026 11:55
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Team: Integrations GitHub request for Integrations area labels Sep 21, 2026
@github-actions github-actions Bot added this to the Version 30.0 milestone Sep 21, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept with Suggestions

What this PR does

This change limits Shopify webhook subscription payloads by passing topic-specific includeFields when creating subscriptions. The new GraphQL request is valid for both changed topics, and the selected fields match the two webhook consumers: order-created webhooks only need the trigger, while bulk-operation webhooks need the operation ID and type before the code fetches the full operation status.

Problem-solution fit

Fit: Strong

The reported problem is that webhook subscriptions without a field list receive more payload data than the connector needs. The diff directly changes subscription creation and keeps the downstream handling aligned with the smaller payload.

Suggestions

S1 (🟠 Moderate): Add request-body assertions for includeFields
The webhook tests still only check that a subscription is created. Please assert that the create-subscription request sends ["id"] for ORDERS_CREATE and ["admin_graphql_api_id", "type"] for BULK_OPERATIONS_FINISH, so this does not silently regress to full webhook payloads later.

Risk assessment and necessity

Risk: The regression surface is limited to newly created or recreated Shopify webhook subscriptions. If the field list is wrong, subscription creation can fail or a callback can miss the ID/type data that the connector expects, but this does not touch posting, ledger entries, or stored financial data.

Necessity: The change is justified because the connector only needs small topic-specific fields from these callbacks. The scope is narrow and avoids changing existing subscriptions automatically.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11658 round=1 by=alexei-dobriansky at=2026-09-21T22:21:27.4296192Z lastSha=c4cdd4ff1370cc6c5f63f4b1c3e2f33ceb054bff reviewKey=dcbc41d0f54faac980508ef3d10e66515515cf27ed57a3e4585632255e7a9373 suggestions=S1@c72eefca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Team: Integrations GitHub request for Integrations area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants