You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have noticed a strange behavior with the workflow not executing some instructions.
For instance an error is never raised in the following code:
constgetNullValueStep=createStep({name: "getNullValueStep"},()=>{returnnewStepResponse(null);});exportconstfaultyWorkflow=createWorkflow({name: "faultyWorkflow"},()=>{constmyNullValue=getNullValueStep();transform({myNullValue},({myNullValue})=>{if(!myNullValue){thrownewMedusaError(MedusaErrorTypes.NOT_ALLOWED,"Null value caught!");}});transform({},(someObject)=>{constmyNullValue=null;if(!myNullValue){thrownewMedusaError(MedusaErrorTypes.NOT_ALLOWED,"Null value caught!");}});returnnewWorkflowResponse(true);});
How is that possible ?
It would be great to know how workflow actually work.
Expected behavior
Errors should be raised.
Actual behavior
Errors are not raised in workflow.
Link to reproduction repo
N/A
The text was updated successfully, but these errors were encountered:
The docs on transform is very sparse right now, we will add some more documentation on how it works, and how to use it.
But in the meantime, in short:transform is not evaluated unless its passed to a step or the workflow response, which is why you aren't seeing your error being thrown, as the transform is never used. Transforms are not the best place to do validation, you should instead do so within a step.
Package.json file
Node.js version
20.14.0
Database and its version
16.3
Operating system name and version
Linux Mint 21.2 Cinnamon
Browser name
No response
What happended?
We have noticed a strange behavior with the workflow not executing some instructions.
For instance an error is never raised in the following code:
How is that possible ?
It would be great to know how workflow actually work.
Expected behavior
Errors should be raised.
Actual behavior
Errors are not raised in workflow.
Link to reproduction repo
N/A
The text was updated successfully, but these errors were encountered: