Open Anbranin opened 7 years ago
Oh gosh darnit. Well, this is what happens when you just assume something is a problem because it happened once in production and don't actually look at the code.
Well, I mean, it did happen. In particular, the way that renumbering works, its possible that renumbering could end up partially applied.
So, this isn't a systematic logic error, but it is still a bug.
Seems like perhaps a transaction block would be a good way to protect against this.
For example, if you have questions 1, 2, 3, 4, 5 and delete question 3, you'll have questions 1,2,4,5 remaining. Thus the next time you try to "move" questions, they'll fail in the spot of the missing number. Re-ordering them when a delete call is made should be sufficient.