fix: improve user validation and error handling in execution routes#67
Conversation
📝 WalkthroughWalkthroughThree files across the execution pipeline are being refined: authentication validation now requires explicit user ID presence, execution payloads ensure input data is consistently populated, and error handling in the registry is improved with safer type casting. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/worker/src/engine/executor.ts (1)
46-52:⚠️ Potential issue | 🟠 MajorAvoid dropping valid falsy inputData and keep context/storage consistent.
Using a truthy check turns valid inputs like
0,"", orfalseinto{}and also diverges fromcontext.inputData(which still uses the original value). Normalize once with nullish coalescing and reuse it for both persistence and context.🔧 Proposed fix
- const nodeExecution = await prismaClient.nodeExecution.create({ + const normalizedInputData = currentInputData ?? {}; + const nodeExecution = await prismaClient.nodeExecution.create({ data:{ nodeId: node.id, workflowExecId: workflowExecutionId, status: "Start", - inputData: currentInputData ? currentInputData : {}, + inputData: normalizedInputData, startedAt: new Date() } }) @@ - inputData: currentInputData, + inputData: normalizedInputData, };
Summary by CodeRabbit
Release Notes
Bug Fixes
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.