-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty results in reply.readAll() when receiving response from Core REST API #7335
Labels
Comments
In addition to what you listed, this may be a case of needing to check |
@qstokkink thank you for this info, I'll add handling of |
Should be fixed in #7334 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes reply does not contain any data (see #7297, #7333). The actual reason for this is currently unclear.
It is possible that sometimes Core REST API actually returns an empty result, although it should not do this. All results from REST API are returned in JSON format, and even if the result by error does not contain any keys and is an empty dict, it is still not empty when serialized as a string:
"{}"
.Even when request processing leads to an error, the result should not be an empty string - it should still be a JSON dictionary with an
"error"
key that describes the error.Another possibility is Core correctly returns the result, but on the GUI side, the
QNetworkReply
instance is garbage collected beforereply.readAll()
was called. Looking at the code, it is hard to say how it is possible as:QNetworkReply
instance is held by theQNetworkRequest
instance.QNetworkRequest
instance is added to theRequestManager.active_requests
set.QNetworkRequest
instance should be removed from theRequestManager.active_requests
set only at the end of theRequest.on_finished
method whenreply.readAll()
should be already called.The problem does not look critical, as it only happens sometimes. It can probably be ignored, but I created the issue so we can refer to this problem later.
The text was updated successfully, but these errors were encountered: