-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: unable to delete users who have published (usernotification table) #2824
Comments
Fixed in ff12dfb To test:
|
Getting 500 error when deleting user with published dataset: [2016-01-06T12:32:04.730-0500] [glassfish 4.1] [INFO] [] [edu.harvard.iq.dataverse.DatasetPage] [tid: _ThreadID=52 _ThreadName=jk-connector(1)] [timeMillis: 1452101524730] [levelValue: 800] [[ retreived version: id: 60, state: RELEASED]] [2016-01-06T12:32:35.886-0500] [glassfish 4.1] [INFO] [] [edu.harvard.iq.dataverse.authorization.AuthenticationServiceBean] [tid: _ThreadID=27 _ThreadName=http-listener-1(1)] [timeMillis: 1452101555886] [levelV [2016-01-06T12:32:35.914-0500] [glassfish 4.1] [WARNING] [] [org.eclipse.persistence.session.file:/usr/local/glassfish4/glassfish/domains/domain1/applications/dataverse-4.2.3/WEB-INF/classes/_VDCNet-ejbPU] [tid Local Exception Stack: |
Right. Such an error is expected for now. Here's the Javadoc on the deleteAuthenticatedUser method (emphasis mine):
Interest in deleting users has been expressed at https://groups.google.com/forum/#!topic/dataverse-community/NXnVDrh1-h8 so maybe we should make this more real and document it? Personally, I would prioritize the "disable user" case in #2419 which is probably more common. @scolapasta had some feedback about my fix at ff12dfb about how a cascade delete, if done carefully would be cleaner. I'll pass this to him to decide what additional changes he wants in 4.2.3 (if any) since we're now in code freeze. My question is what should happen to the |
I raised this specific question about the "releaseuser" at #2825. |
We shouldn't delete users who have "done" something - created a dataset, released a dataset, etc. Deleting user notifications and role assignments is fine. But we do need to track who created or released - in those cases, if anything, we would want to disable them as @pdurbin metioned and is tracked by #2419. However, we should make the API call cleaner, I think, by checking for these things first and proviing a friendlier message. |
OK, #2825 is now tracking the cleaner API call, passing this one to QA. |
Confirmed was able to delete user with notifications after removing created objects. |
I'm in the 4.3.2 branch (e10e6fb) writing API integration tests as part of #2746 and now that I'm starting to publish dataverses and datasets via API I'm no longer able to delete the users that created them. I'm getting this:
org.postgresql.util.PSQLException: ERROR: update or delete on table "authenticateduser" violates foreign key constraint "fk_usernotification_user_id" on table "usernotification"
Detail: Key (id)=(54) is still referenced from table "usernotification".
As I mentioned on the Google Group recently at https://groups.google.com/forum/#!topic/dataverse-community/NXnVDrh1-h8 I'm not sure how much we want to support this operation of deleting users but for testing it can be useful.
The text was updated successfully, but these errors were encountered: