Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

First test fails for OneNote in E2E app #78

Open
joshgav opened this issue Apr 24, 2015 · 2 comments
Open

First test fails for OneNote in E2E app #78

joshgav opened this issue Apr 24, 2015 · 2 comments
Labels

Comments

@joshgav
Copy link
Contributor

joshgav commented Apr 24, 2015

When running all the tests for OneNote, the first test frequently fails. This seems to be because of a race condition between the API call and the two calls to complete OAuth authorization - that is, authorization hasn't completed in time for the first API call. Let's see how we can better wait on completed authorization. Perhaps this would be in the LiveAuthClient itself?

@peternied @ovenado

@peternied
Copy link

Shouldn't the connections objects know the state the authorization systems are in to wait/refresh until they can get the credentials for the request? Example of how this was done, https://github.com/OneDrive/onedrive-explorer-android/blob/master/onedriveaccess/src/main/java/com/microsoft/onedriveaccess/InterceptorFactory.java

@joshgav
Copy link
Contributor Author

joshgav commented Apr 24, 2015

Need to think about this a bit more. I think the difference might be that we call loginSilent on each API call, allowing the underlying auth client to decide whether to get from cache or make a network call. In your example you call getSession() which I think would always be static.

The pattern we use is based on the pattern for ADAL recommended by @vibronet - call acquireTokenSilent every time and let the lib decide what to do.

Relevant source:
BaseODataContainer
LiveAuthDependencyResolver
ADALDependencyResolver

@marcote marcote added this to the Immediate milestone Apr 25, 2015
@marcote marcote added the bug label Apr 25, 2015
@joshgav joshgav removed this from the Immediate milestone May 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants