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
Waterline truncated a join table - this is a MAJOR issue #5454
Comments
Might also be related to https://github.com/balderdashy/waterline/issues/548. |
It seems it is related to this #799 issue too |
Just posted a PR in #815 for this |
Also related to / duplicate of https://github.com/balderdashy/sails-mysql/issues/174 |
Wow! So this is a known issue for more than a month now. I had a major data loss in production (lost one day since i had to restore a nightly backup) that could have been avoided by simply disclosing the issue on the sails list. That's it, i'm done with waterline. Thanks for the kick start but, i'm rewriting the codebase to use another lib. |
@mackeeper I'm so sorry about that, it sounds awful and I'm truly sorry waterline was the cause of this. This should now be fixed in |
Closely related, also urgent: #858. |
I had an issue on a production server where all data from a join table was dropped. After days of investigation, I found out that waterline generated a delete statement without any where clause on that table.
Repro steps:
See the last delete statement that does not have a where clause. This will in fact truncate the table thus removing players from all games.
I traced the code and the following change created this issue: balderdashy/waterline@388473f
I tried commenting the if and while I get an exception because the second delete does not return any result (
var mappedValues = result.map(function(vals) { return vals[pk]; });
will not contain anything), I don't get any dataloss. Do I need to say that it is better to have an error because of concurrency instead of a silent truncation of all data?The text was updated successfully, but these errors were encountered: