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

Add Ability to Delete All Saved Passwords #2265

Merged
merged 51 commits into from
Mar 8, 2024
Merged

Conversation

aataraxiaa
Copy link
Contributor

@aataraxiaa aataraxiaa commented Feb 26, 2024

Task/Issue URL: https://app.asana.com/0/72649045549333/1206560791755490/f
Tech Design URL: NA
CC:

Description:
This PR adds the ability to delete all passwords via a single action. It also includes changes to the Settings screen.

Steps to test this PR:

  • Delete All Option Not Available if No Passwords Saved
  1. Open the Autofill menu
  2. Ensure you have no passwords saved
  3. Open the Autofill more menu
  4. Observe the ‘Delete All Passwords…’ menu item is disabled
  • Delete All (Single Password) - Sync Disabled
  1. Open the Autofill menu
  2. Add a single password
  3. Open the Autofill more menu
  4. Select the ‘Delete All Passwords’ menu item
  5. Observe an alert appears with the relevant copy (e.g "(1)” is shown as the number of passwords, copy contains no references to sync)
  6. Choose ‘Delete'
  7. Observe the user is asked to authenticate
  8. Authenticate
  9. Observe an alert appears with confirmation of delete copy
  10. Open the Autofill menu
  11. Observe all passwords are deleted
  • Delete All (Multiple Passwords) - Sync Disabled
  1. Open the Autofill menu
  2. Create or Import multiple passwords
  3. Open the Autofill more menu
  4. Select the ‘Delete All Passwords’ menu item
  5. Observe an alert appears with the relevant copy (e.g “(1000)” is shown as the number of passwords, copy contains no references to sync)
  6. Choose ‘Delete'
  7. Observe the user is asked to authenticate
  8. Authenticate
  9. Observe an alert appears with confirmation of delete copy
  10. Open the Autofill menu
  11. Observe all passwords are deleted
  • Delete All (Single Password) - Sync Enabled
  1. Repeat Delete All (Single Password) - Sync Disabled test steps, with the only change being the copy displayed should be relevant to sync
  • Delete All (Multiple Passwords) - Sync Enabled
  1. Repeat Delete All (Multiple Passwords) - Sync Disabled test steps, with the only change being the copy displayed should be relevant to sync
  • Settings -> Autofill -> Import/Export Hide/Show
  1. Navigate to Settings -> Autofill
  2. Select DuckDuckGo as the password manager
  3. Observe the import and export password radio buttons are visible
  4. Select Bitwarden as the password manager (The setup dialog appears)
  5. Observe the import and export password radio buttons are hidden
  • Authentication
  1. Repeat a Delete all flow but this time lock the macbook at the stage where you are asked to authenticate
  2. Confirm authentication is still required upon unlocking the device
  • Additional Smoke Tests
  1. Lightly test search & confirm everything still works correctly

<!—
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be marked with the DO NOT MERGE label (particularly if it's a draft)
If it's pending Product Review/PFR, please add the Pending Product Review label.

If at any point it isn't actively being worked on/ready for review/otherwise moving forward (besides the above PR/PFR exception) strongly consider closing it (or not opening it in the first place). If you decide not to close it, make sure it's labelled to make it clear the PRs state and comment with more information.
—>

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@github-actions github-actions bot added the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label Feb 26, 2024
Copy link
Contributor

github-actions bot commented Feb 26, 2024

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against 4187dee

@aataraxiaa aataraxiaa marked this pull request as ready for review February 27, 2024 10:30
@aataraxiaa aataraxiaa removed the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label Feb 27, 2024
@aataraxiaa aataraxiaa force-pushed the pete/delete-all-passwords branch from 8a0288e to 418020e Compare February 27, 2024 10:46
@@ -14,8 +14,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "04c35220aa94bd005171086acccadd677400e7d5",
"version" : "111.0.2"
"revision" : "f087cf8389926b58692870bd5a459bad492ce66d"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’ll update this to point to the latest version once the related BSK PR is merged.

@@ -1059,6 +1059,63 @@ struct UserText {
}
}

// MARK: Autofill Item Deletion (Autofill -> More Menu, Settings -> Autofill)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: It’s possible copy with change after review.

Copy link
Contributor

Choose a reason for hiding this comment

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

There is actually a dedicated UserText+PasswordManager.swift that contains all the autofill related copy; perhaps these strings can be moved there too? 🙂


var confirmationAlert: NSAlert {
let accounts = (try? secureVault.accounts()) ?? []
let syncEnabled = syncService.account != nil
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I think on iOS we went with checking if account.authenticated is true. I’m unsure which is the better check, but we check the accounts object at another point in the macOS codebase.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question, in the iOS codebase we're usually using syncService.authState == .inactive which is what I went with.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, I've checked with Dominik and he says syncService.authState == .inactive is best to use as:

we have more states between inactive and active and every other than inactive means that sync is enabled or being enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, thanks @amddg44, I’ll update PR and Ship Review build

@aataraxiaa aataraxiaa requested a review from amddg44 February 27, 2024 10:52
Copy link
Contributor

@amddg44 amddg44 left a comment

Choose a reason for hiding this comment

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

LGTM! V nice work @aataraxiaa

Task/Issue URL: https://app.asana.com/0/72649045549333/1206560791755490/f

Description:
Last remaining translation for Delete All Password feature
Additional changes to Russian translations (as requested by @mallexxx)
@aataraxiaa aataraxiaa merged commit 7ef31da into main Mar 8, 2024
17 checks passed
@aataraxiaa aataraxiaa deleted the pete/delete-all-passwords branch March 8, 2024 10:28
@aataraxiaa aataraxiaa restored the pete/delete-all-passwords branch March 8, 2024 10:58
@aataraxiaa aataraxiaa deleted the pete/delete-all-passwords branch March 8, 2024 10:59
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.

2 participants