cppagent icon indicating copy to clipboard operation
cppagent copied to clipboard

DELETEing an already deleted asset responds with old asset value; expected MTConnectError

Open mnoomnoo opened this issue 1 year ago • 4 comments

Issue 445

mnoomnoo avatar Apr 27 '24 21:04 mnoomnoo

I don't think this is the correct behavior. If you're requesting an asset by id, you should be able to get it. We should discuss.

wsobel avatar Apr 28 '24 17:04 wsobel

when requesting an asset by asset id, how do we tell if that asset id had been previously deleted or not?

robot-ranger avatar Apr 28 '24 23:04 robot-ranger

oh, i see removed="true" in the asset xml element. the issue is removed=true gets included in the response to both the first DELETE REST call, and any subsequent DELETE calls with the same asset id. (until the buffer cycles; obviously)

so it doesnt seem like there is a way to distinguish if the asset was deleted now because of my most recent DELETE or some previous action some time ago

robot-ranger avatar Apr 29 '24 00:04 robot-ranger

The Asset block has a removed property: https://model.mtconnect.org/#Diagrams___19_0_3_91b028d_1579531819046_475681_8369

In XML it will have something like

<CuttingTool removed="true" ....>
</CuttingTool>

wsobel avatar Apr 29 '24 02:04 wsobel

@mnoomnoo and i worked on this together but it can be closed. we had taken a more literal interpretation of REST delete function but if that is not ~~MTConnect~~ ccpagent-canon then lets just close this.

robot-ranger avatar Jul 31 '24 17:07 robot-ranger