Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] Duplicates of users get saved #468

Open
mpgxvii opened this issue May 22, 2024 · 0 comments
Open

[BUG] Duplicates of users get saved #468

mpgxvii opened this issue May 22, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mpgxvii
Copy link
Member

mpgxvii commented May 22, 2024

Please check if the bug has already been reported in the Issues Tab and mention any related issues here.

Describe the bug

  • When the task schedules for all users are generated, an IllegalStateException is getting thrown because of duplicate keys (key is subjectId) in the Subject->Protocol map (which is used to store the questionnaire protocol for each subject)
  • This means that there are multiple users with the same subject ID which shouldn't be allowed
  • When a user/subject gets added to the appserver, there is a check for whether the user with the same subject_id project_id already exists. If it exists an error gets thrown, otherwise it gets successfully saved
  • There seems to be a race condition that allows the user to be saved even if the subject_id : project_id combination is already present

Priority
2

Difficulty
4

Possible Solutions

  • Add unique constraint to users table
  • Add unique constraint to User entity
  • Fix the checking of existing user
@mpgxvii mpgxvii added the bug Something isn't working label May 22, 2024
@mpgxvii mpgxvii self-assigned this May 22, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant