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

Deleting active assignment from device UI does not delete assignment token from device document. #524

Closed
nmarus opened this Issue Jul 29, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@nmarus

nmarus commented Jul 29, 2017

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 get the previously deleted assignment via /assignments/{assignment token}, but when attempting to delete the assignment with the corresponding delete call, the API responds with same error above.

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: 1.11.0.20170627100515

@derekadams derekadams self-assigned this Jul 29, 2017

@derekadams derekadams added the bug label Jul 29, 2017

@derekadams

This comment has been minimized.

Show comment
Hide comment
@derekadams

derekadams Jul 29, 2017

Member

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!

Member

derekadams commented Jul 29, 2017

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!

@derekadams derekadams added this to the 1.12.0 milestone Jul 29, 2017

@derekadams derekadams closed this Aug 16, 2017

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