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

Hashing and automatic indexing for V3 #320

Closed jpwilliams closed 1 year ago

jpwilliams commented 1 year ago

Summary

Adds hashing of step IDs, meaning step IDs passed between the SDK and Inngest are never plain text and of consistent length.

Adds automatic indexing of steps to avoid common uses of step tooling within loops and parallelism. The following example would set the step IDs to A, A:1, and A:2.

const runA = () => step.run("A", () => "result");

await Promise.all([runA(), runA(), runA()]);

Adds a new error code, AUTOMATIC_PARALLEL_INDEXING, which warns if these indexes are added across parallel chains of work, which is harder for the SDK to reason about in V3.

Checklist

Related

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: 783dc215773c1d99aaf64f09d9389e9ecd275d61

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR