Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Deleting active assignment from device UI does not delete assignment token from device document. #524
While in the Web UI, under devices and within a specific device, if an active assignment is deleted, the assignment token does not get removed from the device doc and will still show "assigned" when looking at the full list of devices. Clicking "Release assignment" from there, gets the error that "device assignment token not found." This prevents the device from being reassigned, or deleted.
Of note, while in this state, from the API, you can successfully
With further investigating via mongo shell, I noticed the assignment does not exist in the Assignments collection, which was odd since I was able to get the Assignment from the API. I also verified that the device doc was still was referencing the assignment token in the Devices collection.
I was able to fix this by removing the device from the Devices collection via mongo shell and was then able to re-create and re-assign the device from the UI.
Using build: 188.8.131.5270627100515
We have logic to prevent a device from being deleted when it's assigned, but it looks like there is no logic to prevent an active assignment from being deleted. You should only be able to delete an assignment once it has been released, so this is definitely a bug. Regarding the assignment still showing up via the REST services, this may be a case where it's not being removed from the assignment cache properly. We will double-check on that as well. A fix should be included in the 1.12 release that will be available at the end of next week. Thanks!