logto-io / logto

🧑‍🚀 The better identity infrastructure for developers and the open-source alternative to Auth0.
https://logto.io
Mozilla Public License 2.0
8.66k stars 439 forks source link

fix(core): fix some webhook api body status 404 bug #6311

Closed simeng-li closed 3 months ago

simeng-li commented 3 months ago

Summary

We have received a report from our community indicating that the Organizations.Membership.Updates webhook event returns status 404 in the API response body.

The root cause is that the webhook payload was built and inserted into the webhook queue ahead of the response body and the status code is properly set.

Fix this issue, with the integration test updated.

Testing

Checklist

github-actions[bot] commented 3 months ago

COMPARE TO master

Total Size Diff :chart_with_upwards_trend: +829 Bytes

Diff by File |Name|Diff| |---|---| |.changeset/fast-rats-talk.md|:chart_with_upwards_trend: +551 Bytes| |packages/core/src/routes/role.ts|:chart_with_upwards_trend: +97 Bytes| |packages/core/src/utils/SchemaRouter.ts|:chart_with_upwards_trend: +1 Bytes| |packages/integration-tests/src/tests/api/hook/WebhookMockServer.ts|:chart_with_upwards_trend: +39 Bytes| |packages/integration-tests/src/tests/api/hook/hook.trigger.data.test.ts|:chart_with_upwards_trend: +94 Bytes| |packages/integration-tests/src/tests/api/hook/utils.ts|:chart_with_upwards_trend: +47 Bytes|