-
Notifications
You must be signed in to change notification settings - Fork 121
Watch app: Fix crash when authenticated with site credentials #16094
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
Conversation
|
|
RafaelKayumov
left a comment
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.
Code wise looks good.
I wasn't able to test with the "store credentials only" path. I was re-directed to a web view to re-enter credentials and then approve the connection. I logged out and relogged in but also had to approve connection again in the web view.
What should I change on my stie/user to have the correct "store credentials only" route?
@RafaelKayumov You can try with a Jurassic Ninja site as sites with security plugins may block the native login path entirely. Let me know if you need more help with testing, I can invite you to my test site. |
RafaelKayumov
left a comment
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.
Tested with Jurassic ninja site - was able to execute the right path. Watch app running without a crash.
Just a question - should the watch app generated app password (...watch-app-client...) be visible in site wp-admin in users section?
@RafaelKayumov In most cases the watch doesn't generate password by itself, because by the time the credentials are synced from the iOS app, the app password is already available through the keychain after logging in. The app name creation used to be a lazy var, but I moved it to the initializer to help with unit tests. So now we create an app name for the watch, but it's not always used. I'm still unsure about the path where the watch needs to generate password itself, but it does happen, which caused the crash in 23.0. |

Closes WOOMOB-1279
Description
There are recently a few crashes on the watch app in version 23.0, the crashlog indicates an assertion failure in
DefaultRequestAuthenticator.generateApplicationPassword(). InDefaultApplicationPasswordUseCase, we do have afatalErrorwhen the app attempts to generate password from the watch, assuming this doesn't happen because the watch should be able to pick up the app password from the keychain after it was created upon iOS app login. The crash on 23.0 therefore is quite hard to reproduce.When trying the app on 23.2, the watch app crashes 100% when logging in to the app with site credentials. In this version, I moved the creation of app name to the initializer of
DefaultApplicationPasswordUseCaseto help with unit tests. This causes the watch app to crash wheneverAlamofireNetworkis initalized.This PR addresses the crash by properly getting the model name from WatchKit. This is used to set as the name for the app password if generating a password from the watch app is needed.
Testing steps
Testing information
Tested with both simulator (debug build) and physical devices (alpha build).
Screenshots
N/A
RELEASE-NOTES.txtif necessary.