-
Notifications
You must be signed in to change notification settings - Fork 57
Reservation Assigned to "Deleted User" #526
Comments
I visited the reservation page, which is returning a 404 error. I tried to find the deleted user by going to the Users page and hitting "Show Deactivated Users in List" but that's returning a 500 error. Unfortunately, the dropdown on the reservations list page (shown above) doesn't appear when you click on "Deleted User", so I can't tell what ID that user has. I have also been unable to reproduce this issue. I created a reservation for a user, checked it out, and then edited the reservation to make me the reserver. Upon returning to the list of reservations everything looked fine, I can visit the reservation page and it has been transferred to me. I'll keep digging and see where this came from. |
Ok, I have some more information. In the Reservation model we define the method Now, I've checked, and the original reserver's account still exists. as does Johannes' (to whom the reservation was supposedly transferred). It could be that somehow when transferring the reservation the |
Ah ha! I went into the console and manually changed the Still digging... I'm pretty sure this has to do with one of the links in the view, I'll update after I figure it out. |
Ok, issue resolved. On the bottom of the reservation page, we have the button / link to the manage reservation page (via the
My guess would be that the easiest way to resolve this issue is to simply go into the console and delete the reservation. If I'm not mistaken (verified on my local instance), when we run the following in the console:
it will delete the problematic reservation, and this will automatically set the relevant equipment item as available since it's no longer tied to a reservation. Hope that helps! |
All that said, this is an edge case we should be able to handle, so we need to figure out how to deal with reservations where the user account no longer exists / |
CHECK TO SEE IF SOFT DELETE CAUSED THIS Do we want soft deleting of users? |
I'll get in touch with ITS to run the following commands in the console:
Hopefully this will resolve their issues and give us more information about what caused this (specifically, what is in Make sure that the update / create reservation methods check for bad input (e.g. if you change the reserver, can you send an invalid user ID) --> this might not have been caused by soft delete, but by a bad request. Also get the original reserver's user information (and the current reserver if there is an ID).
Also get all deactivated users (if there are any):
Also get a list of all user IDs in the database (use a collect):
|
Just had a Google Hangout with Michael Dunlap at ITS and we ran the commands above. Apparently during the switch over to Reservations some time between my work above and today the reservation was deleted from the database; Michael sent me the MySQL dump and it wasn't there. There were two deactivated users in the database; Andrew Clifford (it looks like he created an account with the wrong NetID, but it has a higher user ID than the correct account so I'm not sure what the deal is) and Zak Arctander (again, this is an account with an incorrect NetID, the corrected account is active but has a lower user ID). It doesn't seem like they're using soft deletion for users for any particular reason so we can probably phase it out. I'll discuss w/ @caseywatts and we'll close this out. |
@orenyk Does this require further action? (I have to say that the custom-rescue method of "Deleted User" looks like a bad smell to me, although I'm not sure what the systemic solution would be -- disabling users instead of deleting them?) |
I think we can look into a few things before closing this out:
|
Users should never be deleted (#529); the only time something like this would come up now is if the reserver id was somehow set to a non-existent ID. In that (very rare, should-never-happen-unless-hardware-fails-or-data-is-corrupted scenario) I think it's fine to return the dummy user, and we can change the helper to not-render in the case that the reserver doesn't exist (ActiveAdmin or cancel reservation button can be used to delete the reservation) |
Agreed, I'll review #714 and close once it's merged. |
From Art (see screenshot below):
Not sure what's going on, will try to check it out later.
The text was updated successfully, but these errors were encountered: