-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Bug 1226652 - Login List Multiselection and Deletion #1384
Conversation
sleroux
commented
Dec 23, 2015
- Added multi selection functionality to login list
- Search view now retains search after navigating to detail view
- Selected logins from list can be deleted
case of local-only logins or deleted across synced devices in synced account logins. | ||
|
||
- parameter deleteCallback: Block to run when delete is tapped. | ||
- parameter hasAccount: Boolean indicating the user has a FxA account connected. |
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.
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.
So on desktop, I can configure what I want to sync so it's not enough to know if they have an account, I also need to know if they've enabled password syncing.
Looking through the code it seems this configuration is part of the 'sync' prefs branch:
https://github.com/mozilla/firefox-ios/blob/master/Providers/Profile.swift#L685
Looks like if metaGlobal scratchpad doesn't include the 'passwords' collection, that means that password sync is not enabled (inferred from: https://github.com/mozilla/firefox-ios/blob/master/Sync/Synchronizers/Synchronizer.swift#L177) and this scratchpad lives inside the SyncStateMachine.
What would be the best way to expose this?
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.
The simplest — and most accurate — thing to do is to ask SyncablePasswords
if there are any passwords that would propagate as deletions; not only does this avoid trying to extract state from the account, which is complicated and error-prone, but it also correctly muffles the warning if they haven't synced passwords yet, have none saved, or already wiped them. Storage is the source of truth!
For history, #1370 calls this hasSyncedHistory
, so I'd ape that.
This basically comes down to checking if loginsM
is non-empty or loginsL
has anything with a sync_status
that's not New
. We're effectively trying to figure out if SQLiteLogins.removeAll
will leave deletion sentinel rows in loginsL
.
cb40d2d
to
3fd51e3
Compare
private func searchLoginsWithText(text: String) -> Success { | ||
activeLoginQuery = profile.logins.searchLoginsWithQuery(text) | ||
.bindQueue(dispatch_get_main_queue(), f: reloadTableWithResult) | ||
return activeLoginQuery! |
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.
You can drop this down to one line. Wait, that's not true.
Did I already land |
Not yet - I duplicated the code from that PR. |
Could you do the thirty-second test of that PR and land it? |
Yup |
3fd51e3
to
07f041f
Compare
", is_deleted = 1" + | ||
", password = ''" + | ||
", hostname = ''" + | ||
", username = ''" + |
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.
Nit: if you keep the old indentation throughout, it makes this all clearer.
LGTM. |
07f041f
to
55a167a
Compare
@sleroux I found one minor bug: Click Edit, then Select All, then go back, then click Edit again. The button says Deselect All even though nothing is selected. Other than that, LGTM besides the layout question above. |
Thanks for finding that bug. I've added a UITest to check for it as well as a fix. |
e01e360
to
c157118
Compare
…s from the list view
…le logins in a transaction
c157118
to
e816bba
Compare
Bug 1226652 - Login List Multiselection and Deletion, r=bnicholson, rnewman