snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

If the user ID and the location ID are the same, then big problems may arise in the future

Open UserGoodtm opened this issue 5 years ago • 3 comments

Please confirm you have done the following before posting your bug report:

Describe the bug Problems arise if the user and the location have the same ID number

To Reproduce If the user ID and the location ID are the same and if assets are assigned to this location, then when the user is deleted, all assets assigned to the location are released from assignment (returned to the warehouse). For example, a location with id 23 has multiple assets assigned to it. I delete a user with id 23, when deleting a user, I select the asset status-ready for deployment. Even if the user did not have any assigned assets, all the assets assigned to the location with id 23 will be released and they will be assigned the status "ready for deployment".

Probably, this bug can affect everything that has the same id numbers.

I discovered this error a long time ago, wrote here on git, but there was no time to seek the truth from the developers. Someone from the community helped, and said that the error was due to the matching id numbers. I ask the developers to pay attention to this gross error and fix it in new releases of the program.

Screenshots 1 2 3

UserGoodtm avatar Feb 26 '21 18:02 UserGoodtm

@inietov can you take a look at this one?

snipe avatar Feb 26 '21 19:02 snipe

I just saw this and was reminded of the issue I had earlier in the year (see here) - just had a look at the logs, and the User and the Location were both ID 26, so same issue - items from both were checked in, even though only the user should have had their items checked in.

douglasac10 avatar Mar 01 '21 05:03 douglasac10

I was checking this and I think is highly unlikely that affects other parts. The issue was caused because when we make the bulk update of the assets belonging to the user, we get their user id and just check in every asset that has that id, but don't check the assigned_type column, to assure that only that user's assets get actually checked in.

inietov avatar Mar 01 '21 19:03 inietov