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
There is a validation for tests to make sure there cannot be two tests with the same XML_ID for the same task. However this validation appears to be broken because I can just create tasks with tests that have the same XML_ID.
I guess Rails performs the validation of both tests before they are saved to the database and each validation check does not find the other test in the database so they just pass and get written to database successfully.
We should check if there are similar issues in other models.
EDIT: You can create a task like that but you cannot edit it afterwards because then the tests are in the database and the validation fails.
The text was updated successfully, but these errors were encountered:
Indeed, I can confirm that this is a bug in the current implementation. We also noticed that when implementing contributions, but just added corresponding comments in the fs_task_contrib branch, yet without a ticket nor fixing it. From the tests I've made, I think this is an issue for several models, not just Test.
As far as I understand the issue, it only affects objects that are saved through nested_attributes. Since we are only using nested_attributes for ModelSolutions, Tests and TaskFiles and the TaskFiles need a specific validator anyway, we only need to find a solution for Tests and ModelSolutions.
I suggest we add the necessary database constraints and a validator that we can use for both models.
There is a validation for tests to make sure there cannot be two tests with the same XML_ID for the same task. However this validation appears to be broken because I can just create tasks with tests that have the same XML_ID.
I guess Rails performs the validation of both tests before they are saved to the database and each validation check does not find the other test in the database so they just pass and get written to database successfully.
We should check if there are similar issues in other models.
EDIT: You can create a task like that but you cannot edit it afterwards because then the tests are in the database and the validation fails.
The text was updated successfully, but these errors were encountered: