Basically we should never be raising the master Exception class, really.
The enclosing class has error handling in case this returns None already, so this fix is easy.
Contributes to Sentry issue CURA-Y5.
Even though the metadata of the machine was updated when it was
rediscovered, the new cluster id was not updated in all its references
(such as in the _remote_clusters and in the _um_cloud_printers dicts).
This commit fixes that issue by properly updating all the entries
that depend on the machine's cluster id.
CURA-7505
Since the host_guid is unique to the printer, it is more reliable for
identifying the cloud printers. This comes in handy when the cloud
printer is removed from the account and re-added. With the host_guid,
the printer that is added again can be properly identified as an
existing Cura cloud printer, and be linked to the original. To
achieve that, the META_CLUSTER_ID of the printer is updated with the
new one that is generated when the printer is added again to the
account.
CURA-7505
The autosync, which happens every 30 seconds, will now also inform the
connection status when the get request succeeds or fails, which is an
indicator of whether the internet is reachable.
CURA-7492
This has to be done in order to avoid weird actions taking place, such
as the user pressing to remove the printers while another sync is
happening.
CURA-7454
After 30 seconds a new sync will be initiated, which will alter the
conents of self.reported_device_ids, thus making the current message
deprecated. Therefore, it is best to have a maximum lifetime of 30
seconds.
CURA-7454
When the "Printers removed from account" message pops up, it will give
the option to the user to remove all the printers that are not linked
to his/her account from Cura. Since this action removes all
configurations, it first pops a confirmation question box, and if the
user insists, these printers are purged from Cura.
Note: In order to properly delete all the files, the printers have to
be activated first before they are removed, or else some extruder
files in %appdata%/cura/<version>/user and %appdata%/cura/<version>/
extruders remain.
CURA-7454
Previously the print job was sent with multiple PUT requests. This was necessary since the request was made with the Python Requests library, which freezes the interface while it's running. By breaking the upload up in chunks, it would at least periodically keep updating the interface (4 times per second or so, depending on your internet speed and Ultimaker's). Later on, this was replaced by a QNetworkRequest which doesn't freeze the interface in a refactor, but it was still broken up in chunks.
Recently that was again refactored to use Uranium's HttpRequestManager, which under the covers also uses QNetworkRequest. This also doesn't freeze while uploading, which is good. However for some reason the second chunk would always give a QNetworkReply::ProtocolUnknownError, which is a bit of a catch-all error for any HTTP status codes not supported by Qt. I was not able to figure out what was really going wrong there, but it has something to do with the content-range header and making multiple requests.
Instead of fixing that, I've removed the chunking. This simplifies the code a lot and doesn't have any implications for the user, since it still doesn't freeze the interface while the network request is ongoing. It should be slightly faster to upload, and reduce load on the server too.
However the disadvantage is that the original bug is probably still there if it was a bug in the HttpRequestManager. If it was a bug in the ToolPathUploader I probably deleted the bug here.
Contributes to issue CURA-7488.