-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
[iOS] Address Bad UX on Password Change #1431
base: main
Are you sure you want to change the base?
Conversation
I don't want to claim to be the authority in this area but I have a couple of thoughts:
Localization for any strings can be found in the Translations folder. If you make the item in English, it can be called from code using ![]() Let me know if you need any help on the items above! As I mentioned, I'm definitely not the authority so if @LePips has any other insight/direction, his advice is absolutely the correct direction to take this! But, I think the 3 items above would help flesh this out a bit more and make this more well rounded experience for these cases. |
After some analysis it turns out that setting a new I am also not super familiar with the navigation pattern used here. I am sure there are a couple mistakes with my approach so would appreciate any guidance! |
Thanks for the UX consideration! An implementation to fix this flow would consist of 2 parts: duplicate user sign in and what to navigate to/properly do when presented with a 401. In UserSignInViewModel and UserSignInView, we should already have the foundations in place to allow overriding local user access tokens when signed in again. Although, I really wish past me detailed what issues need fixing. The main navigation ideas are to: I don't consider 401 that prevalent of an issue to justify 1 and 2, and think we can just go with 3 by seeing what isn't working. |
Apologies @JPKribs and @LePips, I just realized I didnt push my changes from last night. I added some mechanisms to navigate back to the sign-in view from server check. I also re-worked the sign-in flow to better handle the case of a UserState still existing. It seems like under the hood, the duplicate user flow was updating the accessToken anyways. The confirmation dialog was the only thing preventing the user from progressing. Please let me know if im on track with all of this. I would specifically appreciate guidance on how to leverage Stinsen. I was having some trouble searching for views in the navigation stack in order to dismiss modals. Thanks |
No worries at all! I am traveling this week so I apologies if I don't respond. I only have element on my computer so I'm slower on Matrix than I am on Github. For UI, this is what I originally thinking. Please bear with me for the filler text. I don't have a great idea of the wording that makes the most sense. Personally, I like the idea that we just retain the API error but just make a note under. This way, we're not obscuring 401 from those who want that information while providing a set of directions for those who want that. Retry + Re-authenticateSimulator.Screen.Recording.-.iPhone.16.Pro.-.2025-02-13.at.20.46.42.mp4This is what I did to make this work. Feel free to use any of it that you like:
For that formatting, I did update
This should go to SWITCH users instead of fulling signing them out. From there, adding a context menu above ![]() This would just route them back to the sign in page but pre-set the username to their previous user. Then, just regular signup but replace the Again, anything @LePips says trumps what I am saying here but this is how I would approach it since I think we can just hook into all the existing login logic and the |
Video demodemo.mp4Just pushed up a change to make the flow a bit simpler navigation-wise. I could add some more enhancements like the update button on long press and a flow to pre-populate the username but I did want to get your guys opinion on the current mechanics, first. Thanks! |
That seems good for flow! My only big notes are UI nitpicks which I know you're still working on. Only functional change, I might just have the replace token still pop up a confirmation dialog first. Just say "This will update your password for user. Are you sure you want to proceed?" That should both work for duplicate user and updating a password. Other than that, flow looks great IMO! For UI nitpicks, feel free to take/ignore any of the below!
Nothing that big, and I know you had some work in mind there so feel free to ignore any of those you don't need! Great work so far! |
Just pushed up the UI updates. Let me know what you think! Here is the updated flow: demodemo-update-style.mp4 |
IMO, this looks great! Only change I would change "Back" to "Switch User" using L10n.switchUser. Just since we have the label for it and it more accurately mirrors the action being performed. "Back" works if we come from the login screen each time but if you are already logged into the account when you enter the app, "Back" doesn't mean as much. It's a really tiny item so I'm not that worried about it but just while we're looking at it I thought I would say. Other than that, I think this looks solid! ![]() This is just using this on tvOS
So, I think the route we would want is to have it go through the regular Other than those 2 items, this looks great! Let me know if you have any questions! We're getting to some weird edge cases so overall what you have is solid but I just want to make sure that the steps have feedback so users who run into these weird cases have some visibility into what is going on. |
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.
I've only briefly played around with this, but there seems to be a bug in the simulator where:
1 - 401 user server check
2 - on select user, select 401 user
the app hangs. I haven't been able to test on device but this still shouldn't be happening and seems new to this PR.
@@ -215,7 +181,7 @@ final class UserSignInViewModel: ViewModel, Eventful, Stateful { | |||
} | |||
} | |||
|
|||
private func signIn(username: String, password: String, policy: UserAccessPolicy) async throws -> UserState { | |||
private func makeSignInRequest(username: String, password: String) async throws -> AuthenticationResult { |
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.
Don't need a separate function for this, just inline in the one place it's used. Also, this would be returning the result, not the actual request.
Summary
My contribution here, would appreciate any feedback.
Resolves: #1413
Previously a user would enter a 'retry' loop when attempting to log into an account that has had its password changed. This fix seeks to provide the user clearer verbiage and add an exit to the flow. This is done by catching
APIError(401)
inside theServerCheckViewModel
and using it to trigger a new view state inServerCheckView
Outstanding Items
Would specific feedback on:
Screenshots
New screen


Example flow gif