This occurs when there's a timeout, on some systems, when asking for the password to the keyring. We'll interpret a timeout as a refusal to enter a password.
Fixes Sentry issue CURA-332.
If two requests to the API occur at the same time, they will both see at the same time that they need an access token, and if it is expired they will both see that it needs refreshing. The server then sees two refreshes, both with the same refresh token. This is not allowed. The second one then gets a failure to refresh the token, which causes the user to log out.
Instead, we'll stop one of the refresh requests. They were fire-and-forget anyway, so it's not needed to actually continue the request.
Contributes to issue CURA-8539.
The return type missing caused the type checker to think it returned Any, which is clearly not true. And the type missing from _user_profile caused it to think it always had to be None, which is nonsense in any application.
Contributes to issue CURA-8539.
It gives two parameters, additionally an error code. However our callback wrapper gets the error code from the reply itself so it doesn't need it.
Contributes to issue CURA-8539.
Because not having auth data is a reason to return no profile too. Otherwise the other side might wait for a response for a long time.
Contributes to issue CURA-8539.
It provides 2 arguments (reply and error) which we both ignore and proceed to call failed_callback. And failed_callback may also be None in which case we don't call anything.
Contributes to issue CURA-8539.
As a result, the local webserver now needs to synchronise that with a lock. Otherwise the do_GET function would no longer block, and wouldn't properly be able to return the correct redirect URL.
Contributes to issue CURA-8539.
Now it calls checkToken correctly. However now this _parseJWT is not called correctly since there are things calling this one in an attempt to be synchronous again.
There is the additional issue that we can't call getAccessTokenUsingRefreshToken synchronously now, because this runs on the main thread and it will then block the main thread until the request is made, which is never because the request is also done on the main thread via Qt's event loop.
Contributes to issue CURA-8539.
This involves returning the user profile via a callback.
No longer use the Requests library, which doesn't properly use the SSL certificates locally on the computer like the QNetworkManager does.
Contributes to issue CURA-8539.
The QImage.pixel() function should only get integers.
In theory an input position of -2,-2 would get rounded to 0 now. However that shouldn't occur because the user can't click outside of the window. And if it does occur, it's not really a problem either that it's theoretically picking a position inside of the window when you click slightly next to it.
Fixes#10785.
This is a re-write from a previous attempt. Instead of requests, which doesn't properly use SSL certificates installed on the computer among other things, we'll now use the HttpRequestManager which uses QNetworkManager under the hood and properly uses system settings.
The QNetworkManager is asynchronous which would normally be very nice, but due to the nature of this call we want to make it synchronous so we'll use a lock here.
Contributes to issue CURA-8539.
Conflicts:
resources/definitions/ultimaker2.def.json -> Additions in Arachne around a place where we fixed an enum setting.
resources/definitions/ultimaker3.def.json
resources/definitions/ultimaker_s3.def.json
resources/definitions/ultimaker_s5.def.json
This is very annoying if switching profiles. This is not a critical message. The message should disappear after the default amount of time.
Discovered while working on CURA-8584.