-
Notifications
You must be signed in to change notification settings - Fork 165
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
RCORE-2222 Remove 308 redirect support from App/AppUser #7996
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this reverting to the state before supporting redirection?
Technically yes - the redirection is being removed since there is already support for handling 301/308 redirections in the HTTP transport supplied by the SDK and Core will never actually see a 301/308 response. The only exception to this is the CPP SDK, and I am working on that now so it supports redirections as well. |
|
Unfortunately not, I created realm/realm-cpp#239 for adding redirection support in the CPP SDK. |
Pull Request Test Coverage Report for Build michael.wilkersonbarker_1371Details
💛 - Coveralls |
request = std::move(request)](const Response& response) mutable { | ||
self->check_for_redirect_response(std::move(request), response, std::move(completion)); | ||
request_ref, | ||
[completion = std::move(completion), request = std::move(request)](const Response& response) mutable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to capture self here to keep App
alive for the duration of the request, or is the contract here that the completion is responsible for keeping the App
alive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The completion callback provided to do_request()
captures an App
shared pointer, which will ensure the app sticks around until the callback is called.
The only exception is when the original request is re-sent after successfully refreshing the user access token after the request sent by do_authenticated_request()
initially failed.
I will update this call and add a statement to do_request()
regarding ensuring the callback contains an App
shared ptr instance in the captures.
request = std::move(request)](const Response& response) mutable { | ||
self->check_for_redirect_response(std::move(request), response, std::move(completion)); | ||
request_ref, | ||
[completion = std::move(completion), request = std::move(request)](const Response& response) mutable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to capture self here to keep the App
alive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is only called from do_request()
, so the completion
callback will have a reference to to App, like do_request()
does.
ac5d7f2
to
8a753e5
Compare
What, How & Why?
Removes the 301/308 http redirection support from the app services support in
App
. The redirection tests have been removed in PR #7994.Fixes #7942
☑️ ToDos
[ ] 🚦 Tests (or not relevant)[ ] C-API, if public C++ API changed[ ]bindgen/spec.yml
, if public C++ API changed