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

Bug 1226652 - Login List Multiselection and Deletion #1384

Merged
merged 9 commits into from
Jan 6, 2016

Conversation

sleroux
Copy link

@sleroux 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

As with #1370, this isn't correct — if you're not syncing passwords, you're going to be really alarmed to be told that the logins you delete will be removed from your other devices.

(Also please steal that review request from @st3fan!)

Copy link
Author

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?

Copy link
Contributor

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.

@sleroux sleroux force-pushed the sleroux/Bug1226652-RemoveLogins branch 2 times, most recently from cb40d2d to 3fd51e3 Compare December 30, 2015 14:35
@sleroux
Copy link
Author

sleroux commented Dec 30, 2015

@rnewman I've updated the PR to include the removeLoginsWithGUIDs method and hasSyncableLogins check to properly message the user.

@tecgirl I've added in the the custom checkmark and fox icons as well.

private func searchLoginsWithText(text: String) -> Success {
activeLoginQuery = profile.logins.searchLoginsWithQuery(text)
.bindQueue(dispatch_get_main_queue(), f: reloadTableWithResult)
return activeLoginQuery!
Copy link
Contributor

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.

@rnewman
Copy link
Contributor

rnewman commented Dec 30, 2015

Did I already land queryReturnsResults? I don't see my commits from #1370 in this stack.

@sleroux
Copy link
Author

sleroux commented Dec 30, 2015

Not yet - I duplicated the code from that PR.

@rnewman
Copy link
Contributor

rnewman commented Dec 30, 2015

Could you do the thirty-second test of that PR and land it?

@sleroux
Copy link
Author

sleroux commented Dec 30, 2015

Yup

@sleroux sleroux force-pushed the sleroux/Bug1226652-RemoveLogins branch from 3fd51e3 to 07f041f Compare December 30, 2015 17:06
@sleroux
Copy link
Author

sleroux commented Dec 30, 2015

Updated with fixes and rebased from master to include fixes from #1370

@thebnich mind taking a quick look at 35fddce? Had to do some hackery to accommodate the custom selection icons we want to use.

", is_deleted = 1" +
", password = ''" +
", hostname = ''" +
", username = ''" +
Copy link
Contributor

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.

@rnewman
Copy link
Contributor

rnewman commented Dec 30, 2015

LGTM.

@sleroux sleroux force-pushed the sleroux/Bug1226652-RemoveLogins branch from 07f041f to 55a167a Compare December 30, 2015 18:07
@thebnich
Copy link
Contributor

thebnich commented Jan 4, 2016

@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.

@sleroux
Copy link
Author

sleroux commented Jan 4, 2016

Thanks for finding that bug. I've added a UITest to check for it as well as a fix.

@sleroux sleroux force-pushed the sleroux/Bug1226652-RemoveLogins branch from e01e360 to c157118 Compare January 4, 2016 18:16
@sleroux sleroux force-pushed the sleroux/Bug1226652-RemoveLogins branch from c157118 to e816bba Compare January 6, 2016 16:13
sleroux pushed a commit that referenced this pull request Jan 6, 2016
Bug 1226652 - Login List Multiselection and Deletion, r=bnicholson, rnewman
@sleroux sleroux merged commit a39e055 into master Jan 6, 2016
@sleroux sleroux deleted the sleroux/Bug1226652-RemoveLogins branch January 6, 2016 16:14
isabelrios pushed a commit to isabelrios/firefox-ios that referenced this pull request Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants