Aborted deployments and state script cleanup

Hi all,

I’m using a state script on Download_Enter that uses the server API to get the deployment artifact name. I’m using the name of the artifact to communicate meta-data about the update to the device. The application can then, with user input, selectively allow or delay the update based on the specific metadata.

The success case works just fine but in the case of an aborted deployment, I see no way to detect this situation and cleanup. The docs state that most states have an “Error” transition but it seems that does not correspond to a state script. I see logging info that the client has detected the aborted deployment but there does not appear any way for that to extend to my state scripts.

I guess the right approach is to cleanup in a Sync_Leave script. Does anyone have any other suggestions here?

Also, there are two “Leave” transitions from the Sync state; one to Download and one to Idle. Is there any way to know within the state script which transition is happening?

Drew

I believe that Sync_Leave happens before Download_Enter (you can only be in one state at a time), so I think this won’t work. I suggest cleaning up in Idle_Enter instead, which the client will always return to after an update, regardless of whether it was successful or not.

Not at the time when you leave, no. You’ll have to piece this together by seeing which Enter you reach after the Leave.