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

Fix credentials "Autofill" function #988

Merged
merged 1 commit into from
Jun 18, 2020
Merged

Fix credentials "Autofill" function #988

merged 1 commit into from
Jun 18, 2020

Conversation

di72nn
Copy link
Member

@di72nn di72nn commented May 24, 2020

Fixes #986.

How it worked before:

  1. Get API client list, find one named "Android app".
  2. If not found, create a new API client. Response is ignored.
  3. Get API client list, find one named "Android app". If a client with that particular name is not found, use any other.

The problem was that sometimes (not sure what it depends on) the list in the third step doesn't contain the newly created client. And if there is no other client (with a different name) to fall back to, the autofill fails.

To work around it I added a 1-second pause before the third step. I think this should do it.

There was also a 3+ years old TODO to use the creation result in step 2 (it contains credentials for the created client). I implemented this part, so it should be a little more optimized now.

So here's how it works now:

  1. Get API client list, find one named "Android app".
  2. If not found, create a new API client. Return the credentials if parsing succeeds (should work unless markup changes).
  3. If the previous step failed, wait 1 second and proceed to step 4.
  4. Get API client list, find one named "Android app". If a client with that particular name is not found, use any other.

1. Make a pause before requesting credentials after creating a new client (the actual fix).
2. Parse credentials out of the result of the client creating request (an optimization optimization).
@di72nn di72nn merged commit d42f598 into master Jun 18, 2020
@di72nn di72nn deleted the fix_autofill branch June 18, 2020 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Autofill" credentials doesn't work
2 participants