-
Notifications
You must be signed in to change notification settings - Fork 19
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
remove built in webhook response builder #413
Conversation
🦋 Changeset detectedLatest commit: c04f993 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #413 +/- ##
==========================================
- Coverage 83.40% 83.34% -0.07%
==========================================
Files 98 98
Lines 3441 3428 -13
Branches 588 585 -3
==========================================
- Hits 2870 2857 -13
Misses 560 560
Partials 11 11 ☔ View full report in Codecov by Sentry. |
.changeset/new-paws-win.md
Outdated
"@saleor/app-sdk": major | ||
--- | ||
|
||
Removed `ctx` parameter from SyncWebhookHandler and replace with standalone `buildSyncWebhookResponsePayload` function |
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.
Question: what about AsyncWebhookHandler
? or it didn't have buildResponse
?
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.
it didnt, we do not expect anything specific to be returned from async
in another PR i will introduce a building utility to return errors but I will detach it from handler context
import { buildSyncWebhookResponsePayload } from "@saleor/app-sdk/handlers/shared"; | ||
|
||
new SaleorSyncWebhook(...).createHandler( | ||
req, res, ctx |
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.
Question: we are going to remove ctx
or buildResponse
from ctx
? I'm asking as in the beginning of changeset it seems like we are going to remove ctx
completely 🤔
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.
I intend to remove only buildResponse, ctx stays
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.
If yes - I would rephrase:
Removed `ctx` parameter from SyncWebhookHandler and replace with standalone `buildSyncWebhookResponsePayload` function
to
Removed `buildResponse` parameter from SyncWebhookHandler `ctx` and replace with standalone `buildSyncWebhookResponsePayload` function
@@ -50,16 +50,16 @@ describe("AWS Lambda SaleorSyncWebhook", () => { | |||
webhookPath: `/${webhookConfig.webhookPath}`, | |||
}); | |||
expect(webhook.getWebhookManifest("https://aws-lambda.com/prod").targetUrl).toBe( | |||
"https://aws-lambda.com/prod/api/webhooks/checkout-calculate-taxes" | |||
"https://aws-lambda.com/prod/api/webhooks/checkout-calculate-taxes", |
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.
Suggestion: maybe in the other PR we can run prettier through codebase to fix formatting issues like that? 🤔
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.
Yea, dont know why it didnt work on pre-commit on previous prs
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.
Sorry I do know - I updated prettier and it's defaults changed
679066d
to
c04f993
Compare
No description provided.