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(appium-tizen-tv-driver,tizen-remote): do not always force token #51

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

boneskull
Copy link
Contributor

the only time when we should specifically force a new token is when appium:resetRcToken is true.

also, immediately after instantiation, unless a token has been provided to TizenRemote (or via the env), the hasToken() method may resolve true, but it will not actually set the token in memory from the cache due to it being a naughty side-effect. unless getToken() was explicitly called, the token would not be set in-memory from the cache before the connection attempt. the logic has changed so that, at connection time, we attempt to load the token from cache if one exists (and cache persistence is enabled). if one still doesn't exist after connection, then it will ask for a new one.

also fixes some typescript problems which may actually be a bug in typescript. microsoft/TypeScript#50286

adds a (slow) e2e test suite for checking persistence works

the only time when we should specifically force a new token is when `appium:resetRcToken` is `true`.

also, immediately after instantiation, unless a token has been provided to `TizenRemote` (or via the env), the `hasToken()` method may resolve `true`, but it will not actually _set_ the token in memory from the cache due to it being a naughty side-effect.  unless `getToken()` was explicitly called, the token would not be set in-memory from the cache before the connection attempt.  the logic has changed so that, at connection time, we attempt to load the token from cache if one exists (and cache persistence is enabled).  if one still doesn't exist after connection, then it will ask for a new one.

also fixes some typescript problems which may actually be a bug in typescript. microsoft/TypeScript#50286

adds a (slow) e2e test suite for checking persistence works
@boneskull boneskull added the bug Something isn't working label Sep 28, 2022
@boneskull boneskull self-assigned this Sep 28, 2022
@boneskull boneskull merged commit 7146d39 into main Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant