Skip to content

Commit

Permalink
Add step name or ID when there’s a NESTING_STEPS error (#549)
Browse files Browse the repository at this point in the history
## Summary
When there's a NESTING_STEPS error, debugging it is tricky because the
stack traces can't necessarily determine the correct faulty file.


## Checklist
~~- [ ] Added a [docs PR](https://github.com/inngest/website) that
references this PR~~ N/A, this is augmenting an existing error
~~- [ ] Added unit/integration tests~~ N/A, I don't think it's worth it
~~- [ ] Added changesets if applicable~~ N/A, I don't think it's worth
it.

## Related
- INN-2958
- #546

---------

Signed-off-by: Makara Sok <[email protected]>
Co-authored-by: Jack Williams <[email protected]>
  • Loading branch information
maktouch and jpwilliams authored Apr 23, 2024
1 parent 0703740 commit f759de1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-shoes-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"inngest": patch
---

Add step name or ID when there’s a NESTING_STEPS error
8 changes: 4 additions & 4 deletions packages/inngest/src/components/execution/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,9 @@ class V1InngestExecution extends InngestExecution implements IInngestExecution {
}): Promise<unknown> => {
await beforeExecHooksPromise;

const stepOptions = getStepOptions(args[0]);
const opId = matchOp(stepOptions, ...args.slice(1));

if (this.state.executingStep) {
/**
* If a step is found after asynchronous actions during another step's
Expand All @@ -765,7 +768,7 @@ class V1InngestExecution extends InngestExecution implements IInngestExecution {
*/
console.warn(
prettyError({
whatHappened: "We detected that you have nested `step.*` tooling.",
whatHappened: `We detected that you have nested \`step.*\` tooling in \`${opId.displayName ?? opId.id}\``,
consequences: "Nesting `step.*` tooling is not supported.",
type: "warn",
reassurance:
Expand All @@ -778,9 +781,6 @@ class V1InngestExecution extends InngestExecution implements IInngestExecution {
);
}

const stepOptions = getStepOptions(args[0]);
const opId = matchOp(stepOptions, ...args.slice(1));

if (this.state.steps[opId.id]) {
const originalId = opId.id;
maybeWarnOfParallelIndexing(originalId);
Expand Down

0 comments on commit f759de1

Please sign in to comment.