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're not sure how, but a user submitted a solution to an exercise twice simultaneously.
This caused two assignments to be created for the same (user + exercise + organization) combination, which caused strange behavior for the user, since the guide progress list would show the exercise as failed, but the results for the exercise would should it as passed (after the solution was fixed by the user).
It seems to me there are two problems mixed here:
the guide progress list is not guaranteed to get the same assignment as the exercise view, which is kinda weird,
and the race condition itself; ideally it should not be possible to create two assignments for the same (user + exercise + organization) combination.
The text was updated successfully, but these errors were encountered:
Yup, I agree. However that may introduce a performance hit, since that code is used frequently.
Another solution may be adding a unique constraint in the database for (user_id, organization_id, exercise_id). We might even handle it and find for object again.
🆙 Oh, no, we can not use a transaction there since build just instantiates the object, but it does not persist it, so adding a transaction there will not make it thread-safe @julian-berbel .
We definitely should go for the unique constraint. Error handling should partially go to controller.
We're not sure how, but a user submitted a solution to an exercise twice simultaneously.
This caused two assignments to be created for the same
(user + exercise + organization)
combination, which caused strange behavior for the user, since the guide progress list would show the exercise as failed, but the results for the exercise would should it as passed (after the solution was fixed by the user).It seems to me there are two problems mixed here:
(user + exercise + organization)
combination.The text was updated successfully, but these errors were encountered: