Until now an update posted to a device could only be cancelled from Pantacor Hub while the step was still NEW. Once the device had picked the revision up, the Hub refused the cancel, and the device never looked at its own step again anyway. A long download could not be stopped from the cloud. That is fixed across the Hub, Pantavisor and pvr.
What changed
Pantacor Hub
PUT /trails/{id}/steps/{rev}/cancelis now accepted while the step isNEW,QUEUED,DOWNLOADINGorINPROGRESS.- Session tokens (pvr, OAuth) are accepted on this endpoint. The old check answered 403 to them.
- The owner
wontgoaction and theWONTGOstate stay supported. They are the only exit from a retry loop for devices running older Pantavisor releases. They are marked deprecated in the API docs.
Pantavisor
- While a revision is
QUEUEDorDOWNLOADING, the device polls its own step every ~6 seconds. - On
CANCELit aborts the object and metadata requests in flight, reportsCANCELwith the message “Cancelled as requested by owner”, and returns to idle on the previous revision. The bootloader is never touched, soCANCELis a final state but not a failed one. - Partial objects already on disk are kept, so a later re-post of the same revision does not have to re-download what already arrived once the HTTP Range resume work lands.
- After
INPROGRESSthe device no longer looks for a cancel. Stopping midway once the bootloader may be written is not safe. A cancel set at that point only keeps a device that lost track of the step from fetching and retrying it, which is whatwontgodid.
pvr
- New subcommand
pvr device steps cancel, the owner-side counterpart. It prints the resulting step progress.
How to use it
pvr device steps cancel <DEVICE_ID> --rev=4
pvr device steps cancel https://pvr.pantahub.com/<USER>/<NICK>/4
Or against the API directly:
curl -X PUT \
-H "Authorization: Bearer <TOKEN>" \
https://api.pantahub.com/trails/<DEVICE_ID>/steps/<REV>/cancel
One caveat. The device sends its progress report right after each step poll. A cancel that lands in that short window is overwritten by the report. If the step still shows DOWNLOADING a few seconds after you cancelled, issue the cancel again.
How to get it
- The Hub side is live on api.pantahub.com.
- Pantavisor: on master now (pantavisor#810), in the next release.
- pvr:
pvr device steps cancelis on master (merge request 502), in the next release. Until then, use the API call above.