New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 756798 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug

Blocking:
issue 734965



Sign in to add a comment

[Password Manager] [Username editing] New username value is not saved

Project Member Reported by kolos@chromium.org, Aug 18 2017

Issue description

0. Visit any password form.
1. Type password.
2. Open a fallback for saving.
3. Edit username.
4. Click save.

Expected:
The updated username should be saved. 

Actual:
Saved old username value.

Assign to melandory@, since irmakk cannot be a bug owner.
 

Comment 1 by kolos@chromium.org, Aug 18 2017

Summary: [Password Manager] [Username editing] New username value is not saved (was: [Password Manager] Save prompt saves username value before editing)

Comment 2 by battre@chromium.org, Aug 18 2017

Taking a look now.

Comment 3 by battre@chromium.org, Aug 18 2017

I don't have a development environment for Mac and the bug only happens on Mac. I think the issue is that model->OnUsernameEdited() should be called in disableEditMode, not in controlTextDidEndEditing and that onSaveClicked should then call disableEditMode. But this is just a guess.

Comment 4 by battre@chromium.org, Aug 18 2017

Here is a fix. But I did not get to writing a unittest nor properly verifying the fix locally. It took forever to set up my machine.

https://chromium-review.googlesource.com/621346

Comment 5 by irmakk@google.com, Aug 21 2017

Hi!

Fix is on the way here; https://chromium-review.googlesource.com/c/623669
Also added a test for this case. :)

Little bit more on the explanation side: This does not happen when user saves the password after disabling the edit mode, with pressing enter or tab or any other way that will cause the field to lose focus. This happens, however, when user clicks save button without exiting the edit mode. The old username was saved because we were updating the username *after* the editing is done, and since user clicked save button while still in editing mode, the old username was saved. With current fix, we check the editing mode before saving and updating the username in still-in-edit-mode case.

Comment 6 by kolos@chromium.org, Aug 21 2017

Thanks Irmak.
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2b0a69bac57aa7e1114d147318fab9a4b8e2b91b

commit 2b0a69bac57aa7e1114d147318fab9a4b8e2b91b
Author: Irmak Kavasoğlu <irmakk@google.com>
Date: Tue Aug 22 12:42:08 2017

Fixed the browser crash after editing username and saving & not saving edited username problems

This cl covers 2 bugs.

Bug 756121:
When user edits username, and clicks save button without exiting the editing mode, browser crashes (on Mac platform, Canary). This is because when save button closes the bubble, the editable field loses focus and losing focus causesa notification to the delegate which has been destroyed by dismissing the bubble.

 Bug 756798 :
When user edits username, and clicks save button without exiting the editing mode, old username is saved (on Mac platform, Chromium). This is because the username is updated after exiting the edit mode, and clicking save button while editing the username causes the old username to be saved.

With this cl, when user clicks save button, the edit mode is checked first. If edit mode is on, the username is updated and edit mode is switched off before continuing the saving procedure. Also, unit test added for the case.

Bug: 756121,  756798 
Change-Id: Ic5c1ea7ff61ca1f0333dad42ec896d1a8d4b87e1
Reviewed-on: https://chromium-review.googlesource.com/623669
Commit-Queue: Irmak Kavasoğlu <irmakk@google.com>
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: Tatiana Gornak <melandory@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496286}
[modify] https://crrev.com/2b0a69bac57aa7e1114d147318fab9a4b8e2b91b/chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller.mm
[modify] https://crrev.com/2b0a69bac57aa7e1114d147318fab9a4b8e2b91b/chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller_unittest.mm

Comment 8 by battre@chromium.org, Aug 25 2017

Status: Fixed (was: Assigned)

Sign in to add a comment