inngest / inngest-js

The developer platform for easily building reliable workflows with zero infrastructure for TypeScript & JavaScript
https://www.inngest.com/
GNU General Public License v3.0
414 stars 41 forks source link

Fix Sentry/Express tracing issues when using `app.use()` #440

Closed jpwilliams closed 9 months ago

jpwilliams commented 9 months ago

Summary

Express performs some runtime checks to assess functions being used to handle middleware. When used with Express Sentry middleware (which wraps other endpoints, like Inngest's), our internal use of variadic arguments can produce a function signature that looks like it can't adequately handle a request.

This should be resolved by using the signature of the function passed when creating the serve handler, ensuring we keep the function signature looking healthy.

Thanks for the repro of this issue, @spastorelli! Looks fixed using this PR (inngest@pr-440).

Checklist

Related

changeset-bot[bot] commented 9 months ago

🦋 Changeset detected

Latest commit: cb9f15540f11efe3c966379e80d715e04be52360

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------- | ----- | | inngest | Patch |

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](https://github.com/inngest/inngest-js/new/fix/tracing-express-checks?filename=.changeset/tasty-games-visit.md&value=---%0A%22inngest%22%3A%20patch%0A---%0A%0AFix%20Sentry%2FExpress%20tracing%20issues%20when%20using%20%60app.use()%60%0A)

inngest-release-bot commented 9 months ago

A user has added the prerelease/inngest label, so this PR will be published to npm with the tag pr-440. It will be updated with the latest changes as you push commits to this PR.

You can install this prerelease version with:

npm install inngest@pr-440

The last release was built and published from cb9f15540f11efe3c966379e80d715e04be52360.