mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Don't restart refresh token while it's already processing
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.
This commit is contained in:
parent
608cce491d
commit
3f92b46ac8
2 changed files with 7 additions and 1 deletions
|
@ -66,7 +66,7 @@ class CloudPackageChecker(QObject):
|
|||
self._application.getHttpRequestManager().get(url,
|
||||
callback = self._onUserPackagesRequestFinished,
|
||||
error_callback = self._onUserPackagesRequestFinished,
|
||||
timeout=10,
|
||||
timeout = 10,
|
||||
scope = self._scope)
|
||||
|
||||
def _onUserPackagesRequestFinished(self, reply: "QNetworkReply", error: Optional["QNetworkReply.NetworkError"] = None) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue