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
370 stars 37 forks source link

Fix/incorrect custom fetch wrapping #597

Closed jpwilliams closed 4 weeks ago

jpwilliams commented 4 weeks ago

Summary

A warning log for when a custom fetch implementation is suspected to be broken is a bit too spammy.

A request failed when using a custom fetch implementation; this may be a misconfiguration. Make sure that your fetch client is correctly bound to the global scope.

This log is intended to be shown when we suspect that the given fetch implementation is invalid and seems to not be functioning correctly, for example if it has lost its binding after being passed in an object.

At present, however, it is logged upon every failure, even if it is correctly handled by code further up the stack.

This PR ensures we only log if it's not an expected fetch failure like failing to reach a server, which still indicates that the implementation is functional.

It also fixes an issue where the fetch implementation used by the InngestCommHandler is wrapped and treated as custom if no custom implementation has been given to new Inngest().

Checklist

changeset-bot[bot] commented 4 weeks ago

🦋 Changeset detected

Latest commit: 47fbf1a3e3ffec6ad749216dba66a386ce0007f0

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 commented 4 weeks ago

A user has added the prerelease/inngest label, so this PR will be published to npm with the tag pr-597. 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-597

The last release was built and published from 47fbf1a3e3ffec6ad749216dba66a386ce0007f0.

jpwilliams commented 4 weeks ago

In draft waiting on confirmation from a user.

darwin67 commented 4 weeks ago

In draft waiting on confirmation from a user.

confirmed from user