Skip to content

feat(defers): add transformDeferInput middleware hook - #1574

Open
Linell wants to merge 4 commits into
mainfrom
linell/exe-1815-add-middleware-support
Open

Linell wants to merge 4 commits into
mainfrom
linell/exe-1815-add-middleware-support

Conversation

@Linell

@Linell Linell commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Add transformDeferInput and support for async defer validations

Checklist

  • Added a docs PR that references this PR
  • Added unit/integration tests
  • Added changesets if applicable

Related

Old, PR: #1559
Revert: #1563
Follow Up: #1560

@Linell
Linell requested review from amh4r and scottnuma June 12, 2026 18:51
@linear-code

linear-code Bot commented Jun 12, 2026

Copy link
Copy Markdown

EXE-1815

@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 422d6f8

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

mendral-app[bot]

This comment was marked as outdated.

@Linell
Linell force-pushed the linell/exe-1815-add-middleware-support branch from 35ba654 to 07d5251 Compare June 12, 2026 22:22
mendral-app[bot]

This comment was marked as outdated.

@Linell
Linell force-pushed the linell/exe-1815-add-middleware-support branch from 07d5251 to 8e94ee3 Compare June 24, 2026 22:41
mendral-app[bot]

This comment was marked as outdated.

mendral-app[bot]

This comment was marked as outdated.

@Linell
Linell force-pushed the linell/exe-1815-add-middleware-support branch from fdcf354 to 80e8741 Compare July 8, 2026 21:20
@Linell
Linell force-pushed the linell/exe-1815-add-middleware-support branch from 10f2287 to 422d6f8 Compare July 15, 2026 21:37

@mendral-app mendral-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

All prior comments remain addressed. New changes since last review (abort handle, DeferAbort dedup moved to drain(), async validator support) are clean. The riskiest hunk — prepareDeferOp catching rejections and resolving null to drop ops, with drain() filtering nulls — handles the error path correctly and prevents unhandled rejections from propagating. No new issues found.

What this PR does

Adds transformDeferInput middleware hook and async schema validator support for deferred functions. Refactors LazyOps to store promises (async prep settles after sync ID reservation), moves experiment-key injection after validation/middleware, adds DeferAbort dedup at drain time, and returns an abort() handle from defer(). Integration tests cover all new paths.

Tag @mendral-app with feedback or questions. View session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants