Skip to content

Stop reading the event ID and resource ID headers on events webhooks - #3365

Open
pobed2 wants to merge 1 commit into
Shopify:mainfrom
pobed2:remove-events-event-id-resource-id-headers
Open

Stop reading the event ID and resource ID headers on events webhooks#3365
pobed2 wants to merge 1 commit into
Shopify:mainfrom
pobed2:remove-events-event-id-resource-id-headers

Conversation

@pobed2

@pobed2 pobed2 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Shopify is dropping the shopify-event-id and shopify-resource-id headers from events deliveries, so the libraries should stop reading them.

WHAT is this pull request doing?

Stops reading both headers. shopify-event-id was required, so events deliveries without it would have failed validation once Shopify stopped sending it. eventId and resourceId are also gone from the events result and the webhook context — use webhookId as the idempotency key. Webhooks are untouched and keep X-Shopify-Event-Id.

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have used pnpm changeset to create a draft changelog entry (do NOT update the CHANGELOG.md files manually)
  • I have added/updated tests for this change
  • I have documented new APIs/updated the documentation for modified APIs (for public APIs)

Shopify is dropping shopify-event-id and shopify-resource-id from events
deliveries, so the libraries stop reading them.

shopify-event-id was read with getRequiredHeader, so an events delivery
without it would have failed validation with MissingHeaders once Shopify
stopped sending it. Dropping the requirement is what makes this safe to
ship ahead of the platform change.

eventId and resourceId are gone from EventsWebhookFields and from the
React Router and Remix webhook context. Webhooks are untouched: they keep
the X-Shopify-Event-Id header and the eventId field, so the context type
keeps eventId and its doc comment now says which kind of delivery sets it.

Released as a minor: the breaking moment is when Shopify stops sending the
header, not when the client stops reading it. TypeScript consumers that
read either field off an events delivery will still see a compile error,
which the changeset calls out.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the devtools-gardener Post the issue or PR to Slack for the gardener label Aug 18, 2026
@pobed2
pobed2 marked this pull request as ready for review August 18, 2026 20:09

@lizkenyon lizkenyon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is technically a breaking, so we have a couple of options

Option 1: Mark as major

What you do

  1. Keep the current PR code. The headers are no longer read.
  2. Change the changeset from minor to major.
  3. Regenerate the docs files.
  4. Write a migration note. Tell apps to use webhookId.

Option 2: Deprecate fields, keep similar behavior

What you do

  1. Stop requiring the shopify-event-id header. This is the validation fix.
  2. Keep eventId and resourceId in the public types.
  3. Keep ShopifyEventsHeader.EventId and ShopifyEventsHeader.ResourceId.
  4. Mark all four with @deprecated and a note.
  5. Fill eventId with a fallback value so it stays a string.
  6. Ship as a patch or minor.
  7. Remove the fields in the next major.

The fallback choice

eventId was a required string. If you keep the type but return nothing, callers get undefined. That is still a break for strict code.

To keep the string contract, set a fallback:

  eventId: eventId ?? webhookId,

Question for you:

Is this fallback acceptable based on what eventId and webhookId are intended to represent?

Context:
We try to minimize breaking changes and group them into a breaking change release.
But if semantically the fallback does not make sense, we would have to go ahead and do the breaking change.

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

Labels

devtools-gardener Post the issue or PR to Slack for the gardener

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants