Given how terrible the wifi is on various handhelds(in my case, RG34XX), upgrading PortMaster from within the application is a pretty horrible experience. I think maybe it should keep retrying(or have a configurable max attempts) until it completely downloads the file.
I think(?) you're using curl and I know for a fact that curl has a retry mechanism.
https://everything.curl.dev/usingcurl/downloads/retry.html