Commit c05442e0 authored by Jan Wilken Doerrie's avatar Jan Wilken Doerrie Committed by Commit Bot

[Settings] Fix Deletion Of Passwords

This change augments the fix in https://crrev.com/c/1140853 to cover
other cases the first change missed.

Bug: 862119
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: I59ca0f37aba90009b645b6ddb4b1413c5325f933
Reviewed-on: https://chromium-review.googlesource.com/1142146Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576419}
parent a9a91494
...@@ -153,8 +153,18 @@ Polymer({ ...@@ -153,8 +153,18 @@ Polymer({
// Create listener functions. // Create listener functions.
const setSavedPasswordsListener = list => const setSavedPasswordsListener = list =>
this.updateList('savedPasswords', item => { this.updateList('savedPasswords', item => {
return item.entry.loginPair.urls.origin + '_' + // The item uid is built from index, origin, and username for the
item.entry.loginPair.username; // following reasons: origin and username are enough to describe and
// uniquely identify an entry. It is impossible to have two entries
// that have the same origin and username, but different passwords,
// as the password update logic prevents these cases. The entry is
// required to force a refresh of entries, after a removal or undo of
// a removal has taken place. All entries before the point of
// modification are uneffected, but the ones following need to be
// refreshed. Including the index in the uid achieves this effect.
// See https://crbug.com/862119 how this could lead to bugs otherwise.
return item.entry.index + '_' + item.entry.loginPair.urls.origin +
'_' + item.entry.loginPair.username;
}, list.map(entry => ({ }, list.map(entry => ({
entry: entry, entry: entry,
password: '', password: '',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment