Skip to content
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

[Userpools] Fix network calls to run in background when specified fixes #668 #702

Merged
merged 1 commit into from
Feb 15, 2019

Conversation

minbi
Copy link
Contributor

@minbi minbi commented Feb 15, 2019

Also includes minor refactor of request method call structure.

@minbi minbi added cognito Issues with the AWS Android SDK for Cognito Pull Request labels Feb 15, 2019
@minbi minbi self-assigned this Feb 15, 2019
@minbi minbi force-pushed the userpool-threading branch from 5e6f1c2 to a1c1c2c Compare February 15, 2019 01:31
@minbi minbi merged commit a0b7e63 into master Feb 15, 2019
@minbi minbi deleted the userpool-threading branch February 15, 2019 01:37
return new Runnable() {
@Override
public void run() {
new Thread(new Runnable() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's very hard to understand what is going on here. Do you have any test cases that cover these changes?

E.g. the changes in this commit makes getSessionInBackground call AuthenticationHandler#onFailure() on background thread once user enters (incorrect) username/password and continueTask() has been called. onSuccess() is still called from main thread however. I would have expected the callbacks to run on main thread, or at least be consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a code fix that will be addressing the issue you have pointed out, the release is pending.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, this client calls the onSuccess and onFailure cases on the same thread that foo() is called. Except when the fooInBackground() variant is used, that is when the callbacks are made on the main thread's looper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cognito Issues with the AWS Android SDK for Cognito
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants