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
440 stars 43 forks source link

INN-2861 No longer execute `step.sendEvent()` inline #518

Closed jpwilliams closed 8 months ago

jpwilliams commented 8 months ago

Summary

In INN-1349, step.sendEvent() became an "inline action." At the time, these were intended to address situations where a developer misused step.sendEvent(), assuming it was the only way to send an event, but they didn't want to create a step function; the other actions in the function were not wrapped in step.run().

While this resolved some issues for early adopters, it created a frustrating long-term issue is step.sendEvent() is the first action in a run. An SDK has no way of knowing if it should be a step or not, resulting in the potential that the event can be sent many times.

We should move back to the more explicit model of step.* methods always creating a step function.

The recovery method outlined in the spec (and present in v3+ of the TS SDK) mean that this will not break current flows that rely on this behaviour.

Checklist

Related

linear[bot] commented 8 months ago

INN-2861 Remove inline `step.*` actions

changeset-bot[bot] commented 8 months ago

🦋 Changeset detected

Latest commit: e988c75a57a61c805e37c884ef196a06bb9b0939

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/no-longer-execute-inline?filename=.changeset/funny-pugs-rule.md&value=---%0A%22inngest%22%3A%20patch%0A---%0A%0AINN-2861%20No%20longer%20execute%20%60step.sendEvent()%60%20inline%0A)