Closed jpwilliams closed 8 months ago
Latest commit: e988c75a57a61c805e37c884ef196a06bb9b0939
The changes in this PR will be included in the next version bump.
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)
Summary
In INN-1349,
step.sendEvent()
became an "inline action." At the time, these were intended to address situations where a developer misusedstep.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 instep.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