-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
save command is still written to db, even though subsequent save fails #18
Comments
can you show all the relevant code or give more information? I haven't been able to reproduce this issue. |
It could also be helpful if you showed what the db looked like before and after the run function was called. |
Figured the issue. modelName is being used in rollBackTask instead of collectionName in roller. But mongoose pluralizes model names (i.e Product becomes products (note the lower case)) Also, I've not quite got the use of the iife in rollBackTask. Can't a let step = "" be used? I can give a PR for this |
"let step" in place of iife will work but I don't want to mix different javascript versions. I might eventually refactor the whole library to use es6. |
Feel free to open a pr. They're always welcome 👍 |
@rushabhnagda11 I've actually added this fix as part of the new release. Update your Fawn version and things should work fine. Feel free to reopen this issue if it persists. Thanks for your help 👍 👍 |
Both are mongoose schemas.
task.save(Product,product.product) .save(ProductFinals,_.assign(product.productFinal, {product_id : { $ojFuture : "0._id"}}))
The data in the first command is fine.
Data for the second save command has a validation error (intentional).
Expeceted behavior : Everything is rolled back
Observed Behavior : Goes to the error block of the run command, but the first save is committed to the db.
The text was updated successfully, but these errors were encountered: