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

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

Merged
merged 4 commits into from
Dec 19, 2023

Conversation

jpwilliams
Copy link
Member

@jpwilliams jpwilliams commented Dec 19, 2023

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

  • Added a docs PR that references this PR N/A Bug fix
  • Added unit/integration tests
  • Added changesets if applicable

Related

Some platforms perform runtime checks that assess the number of
arguments being used in a function. We use variadic arguments internally
to ensure support for many platforms/handlers, but makes the function
look strange to the framework at runtime
@jpwilliams jpwilliams added Bug Something isn't working prerelease/inngest Create snapshot releases for a PR for the "inngest" package. labels Dec 19, 2023
@jpwilliams jpwilliams self-assigned this Dec 19, 2023
Copy link

changeset-bot bot commented Dec 19, 2023

🦋 Changeset detected

Latest commit: cb9f155

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

@inngest-release-bot inngest-release-bot added the 📦 inngest Affects the `inngest` package label Dec 19, 2023
@inngest-release-bot
Copy link
Collaborator

inngest-release-bot commented Dec 19, 2023

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 cb9f155.

@jpwilliams jpwilliams merged commit 0fc642d into main Dec 19, 2023
37 checks passed
@jpwilliams jpwilliams deleted the fix/tracing-express-checks branch December 19, 2023 16:14
jpwilliams pushed a commit that referenced this pull request Dec 19, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## inngest@3.7.4

### Patch Changes

- [#434](#434)
[`cb953ee`](cb953ee)
Thanks [@jpwilliams](https://github.com/jpwilliams)! - Fix bad wildcard
export `inngest/components/*` for ESM/CJS compatibility

- [#440](#440)
[`0fc642d`](0fc642d)
Thanks [@jpwilliams](https://github.com/jpwilliams)! - Fix an issue
where Sentry's wrapping of `inngest/express` caused Sentry to throw a
runtime error during instantiation

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working 📦 inngest Affects the `inngest` package prerelease/inngest Create snapshot releases for a PR for the "inngest" package.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use Inngest handlers alongside Sentry integration middleware
3 participants