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

[PM-595] Autofill doesn't work for logins without passwords #5325

Conversation

cagonzalezcs
Copy link
Contributor

@cagonzalezcs cagonzalezcs commented May 1, 2023

Type of change

- [x] Bug fix
- [ ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

An issue was identified where a user is unable to enact the autofill process when a login item does not contain a password. Currently we guard against autofilling the user name of an item when the password is not set by returning early from the AutofillService.generateLoginFillScript() method.

I'm not entirely sure why we do this, as attempting to do an autofill for a login item that does not have a username set, but has a password set, works correctly. Removing the early return from AutofillService.generateLoginFillScript() allows the username from the password-less login item to be autofilled as expected. In testing this behavior, I'm not noticing any significant side-effects or concerns with allowing this to function in such a manner.

Code changes

  • apps/browser/src/autofill/services/autofill.service.ts: We are removing the early return from AutofillService.generateLoginFillScript() that triggers when a passwordless login entry attempts to autofill. This allows the autofill for a passwordless login item to behave in the same manner as an item that contains a password, but not a user name.

Screenshots

Screen.Recording.2023-05-01.at.11.51.07.AM.mov

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
  • Ensure that all UI additions follow WCAG AA requirements

@cagonzalezcs cagonzalezcs added bug needs-qa Marks a PR as requiring QA approval labels May 1, 2023
@cagonzalezcs cagonzalezcs requested a review from a team as a code owner May 1, 2023 16:52
@cagonzalezcs
Copy link
Contributor Author

@djsmith85 @differsthecat

I'm not entirely sure about the ramifications of removing this early return from the AutofillService.generateLoginFillScript method, but in practice nothing seems to break or work unexpectedly. I figure it might be a good idea to ping you to verify that nothing fishy will occur.

@differsthecat
Copy link
Member

differsthecat commented May 1, 2023

@djsmith85 @differsthecat

I'm not entirely sure about the ramifications of removing this early return from the AutofillService.generateLoginFillScript method, but in practice nothing seems to break or work unexpectedly. I figure it might be a good idea to ping you to verify that nothing fishy will occur.

It took some spelunking, but I did find the commit where this check was added here. Judging by the line Autofill custom fields in the commit message, I'm guessing it was added to perform autofill for custom fields, and not break if there is no passsword. The code in this condition has changed slightly (the call to setFillScriptForFocus() was added at some point and I don't have enough familiarity to say what that does), but I wonder if over time the intended behavior was somehow broken.

Copy link
Member

@differsthecat differsthecat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some more investigating but I do not see any apparent issues with removing this early return. Thank you @cagonzalezcs !

@djsmith85 djsmith85 linked an issue May 4, 2023 that may be closed by this pull request
1 task
@cagonzalezcs cagonzalezcs removed the needs-qa Marks a PR as requiring QA approval label May 16, 2023
@cagonzalezcs cagonzalezcs merged commit aa2da57 into master May 16, 2023
16 of 17 checks passed
@cagonzalezcs cagonzalezcs deleted the Client-Integrations/PM-595-autofill-does-not-work-for-logins-wihtout-passwords branch May 16, 2023 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autofill doesn't work for logins without passwords
2 participants