Skip to content

UFAL/User registration duplicites fix#1266

Open
Paurikova2 wants to merge 4 commits intodtq-devfrom
ufal/user-registration-duplicites-fix
Open

UFAL/User registration duplicites fix#1266
Paurikova2 wants to merge 4 commits intodtq-devfrom
ufal/user-registration-duplicites-fix

Conversation

@Paurikova2
Copy link
Collaborator

Problem description

After the import and during DSpace usage, multiple user registrations were created for a single EPerson.

Problem: If an EPerson already existed and was not newly created during the process, a new user registration was still created.

Manual Testing (if applicable)

Copilot review

  • Requested review from Copilot

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses duplicate user_registration rows being created for the same EPerson during import/usage in CLARIN-DSpace (DSpace 7 REST backend), by enforcing uniqueness at both the application and database layers and adding integration tests to validate the behavior.

Changes:

  • Prevent duplicate registrations by updating an existing registration when eperson_id matches (service-layer guard).
  • Ensure the EPerson import endpoint does not leave behind an automatically created “Unknown” registration.
  • Add DB migrations introducing a unique index on user_registration.eperson_id and expand DAO email lookup to support semicolon-separated email values.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
dspace-api/src/main/java/org/dspace/content/clarin/ClarinUserRegistrationServiceImpl.java Updates create() to update an existing registration when eperson_id already exists.
dspace-api/src/main/java/org/dspace/content/dao/impl/clarin/ClarinUserRegistrationDAOImpl.java Expands findByEmail matching to handle semicolon-separated email strings.
dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClarinEPersonImportController.java Removes auto-created registrations during EPerson import so registrations are managed by the dedicated endpoint.
dspace-api/src/main/resources/.../postgres/V7.6_2026.03.10__user_registration_unique_eperson_id.sql Adds a (partial) unique index on eperson_id in PostgreSQL.
dspace-api/src/main/resources/.../h2/V7.6_2026.03.10__user_registration_unique_eperson_id.sql Adds a unique index on eperson_id in H2 for tests/dev.
dspace-server-webapp/src/test/java/org/dspace/app/rest/ClarinUserRegistrationServiceImplIT.java Adds integration tests covering dedup/update behavior and null-eperson cases.
dspace-server-webapp/src/test/java/org/dspace/app/rest/ClarinEPersonImportControllerIT.java Adds an integration test asserting EPerson import does not create a user registration.

--
-- http://www.dspace.org/license/
--

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants