Skip to content
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

add missing "X-Shopify-Triggered-At" in ShopifyHeader #1941

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

llong2195
Copy link

WHY are these changes introduced?

Fixes #0000

I read the documentation: https://shopify.dev/docs/apps/build/webhooks#key-terminology and found X-Shopify-Triggered-At missing

WHAT is this pull request doing?

This pull request adds the missing X-Shopify-Triggered-At header to the ShopifyHeader.

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)

@llong2195 llong2195 requested a review from a team as a code owner January 8, 2025 11:03
Copy link
Contributor

@lizkenyon lizkenyon left a comment

Choose a reason for hiding this comment

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

Hi there 👋

Thanks for your contribution!

I agree that we should have this header value.

I believe though for this value to be accessible we will need to modify the validate function to return this header value. Or are you using this in a different way?

@llong2195
Copy link
Author

Currently I write my own verify webhook function, some needs need to get 'triggered-at' so I just add it in ShopifyHeader enum.

I agree that if someone needs it, it should also be edited a bit

@llong2195 llong2195 requested a review from lizkenyon January 8, 2025 18:02
@lizkenyon
Copy link
Contributor

Thanks for the additional context! @llong2195

Would you be able to update a test for the validate function, to confirm this change?

Afterwards you will also need to add a changeset (pnpm changeset) as well as sign the CLA

@llong2195
Copy link
Author

Thanks for the feedback! @lizkenyon
I tried but ran into too many issues and I don't understand enough to complete the tests. It seems the tests for webhooks are outdated.
Can you help me complete the rest?

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

Successfully merging this pull request may close these issues.

2 participants