Bug 1560042 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

> I was thinking to reduce scope and only do it for generated passwords which would be using a password change doorhanger whereas I think the more common case when not generating would be a save doorhanger, right? How do we handle that case now when not generating (both for update and save prompts)? Do we give an error?

It looks like we handle it without error. So, if you started out with empty username, and type a username that matches an existing login, we switch the main action button to "Update" and apply those changes to the matching login. 

There is code in there to abort and log an error if there are more than 1 potential logins it looks like you are trying to update, but I've not yet figured out how to get into that state, except via auto-saved generated password logins. So my current approach is to remove the auto-saved login from the matches array, around https://searchfox.org/mozilla-central/source/toolkit/components/passwordmgr/LoginManagerPrompter.jsm#1122 and then remove the auto-saved login from storage when necessary.
> I was thinking to reduce scope and only do it for generated passwords which would be using a password change doorhanger whereas I think the more common case when not generating would be a save doorhanger, right? How do we handle that case now when not generating (both for update and save prompts)? Do we give an error?

It looks like we handle it without error. So, if you started out with empty username, and type a username that matches an existing login, we switch the main action button to "Update" and apply those changes to the matching login. 

There is code in there to abort and log an error if there are more than 1 potential logins it looks like you are trying to update, but I've not yet figured out how to get into that state, except via auto-saved generated password logins. So my current approach is to remove the auto-saved login from the matches array, around https://searchfox.org/mozilla-central/rev/96403eac4ff6f96f89a0b120b29bd46540d5705e/toolkit/components/passwordmgr/LoginManagerPrompter.jsm#1122 and then remove the auto-saved login from storage when necessary.

Back to Bug 1560042 Comment 4