There is a problem with group assignments when the group access is modified after generating submissions if there is any student who belongs to both groups.
If the instructor generates submissions before and after changing the group access and there is any student that belongs to both groups, there will be two submissions for this student. This is correct, because each submission is linked with a different group, but when the student looks for their submissions for this assignment, the group is not taken into account, so the method gets 2 submissions instead of 1.
SAK-40875, when the "findSubmissionForUser" method return more than 1 submission, the new cleanup feature tries to delete the most recent submission and keep the oldest, but in this case no submission should be deleted (and even an exception is thrown).
To solve this issue we think there should have been a new method to get the submission for the student, taking into account, not only the assignment and submitter, but also the group.
See the video for the testing plan.