Aborted auto-refresh does not allow manual refresh

A device in slow internet conditions (≈ 30KBps) is failing to perform an auto-refresh which causes the following

# snap changes
ID   Status  Spawn                      Ready  Summary
68   Abort   20 days ago, at 06:06 EDT  -      Auto-refresh snaps "core18", <my snap>

and

# snap refresh <my snap>
error: snap <my snap> has "auto-refresh" change in progress

I can only try a manual refresh after rebooting the device (or probably restarting snapd would allow this too, have not tried). This happens consistently on all devices that have similar internet speed.

You can use snap abort 68 to stop an in-progress or failed refresh, then manually refresh with snap refresh <my-snap>

Thanks for your reply, this will allow me to not reboot the device. But shouldn’t snapd cleanly abort the refresh on failure on it’s own?

It depends, if the download is progressing but just very slowly then from snapd’s prospective things are working albeit slowly so it should continue trying and just wait for it to finish. We could perhaps adjust the error message about snap refresh <snap> to mention that it could be aborted if the user wants to “force” the refresh, or perhaps even an option to snap refresh like

$ snap refresh my-snap --abort-current-changes

which would then ensure if there is a current refresh or auto-refresh change for the snap ongoing that it would get aborted and then the manual refresh would be started as requested.