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

Improve Handling of noData Import Errors #2494

Merged
merged 22 commits into from
Apr 4, 2024

Conversation

aataraxiaa
Copy link
Contributor

@aataraxiaa aataraxiaa commented Mar 25, 2024

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

Description:
Why

  1. When an import data file cannot be found, we treat this as a error, noData , and ask the user for feedback
  2. However, in some cases this error is completely acceptable, and this feedback is non-actionable
  3. User feedback relating to this is noise, not signal

Changes

  1. Stop prompting the user for feedback when we are handling a noData error
  2. When no data is found initially, and user chooses to skip manual import, no summary screen is displayed (the import dialog is dismissed)
  3. Update our ’skipped’ icon (see ✓ Design: New Summary noData Icon)
  4. Update our ‘failure’ icon (see ✓ Design: New Summary noData Icon)
  5. Treat Firefox Bookmarks file not found as noData

Note: Testing below will involve moving your Firefox/Chrome browser data. Make sure you put these files back if you use Firefox/Chrome as your browser

Pre-Requisites for Tests

  1. Install Firefox, and save one username and password in Firefox, and bookmark one site
  2. Install Chrome, and save one username and password in Firefox, and bookmark one site

Steps to test this PR:

  1. Test Firefox No Passwords File
  • Go to ~/Library/Application Support/Firefox/Profiles/
  • Locate your active Firefox profile (if you never set up a Firefox profile, it’s likely called something like "ebovof0c.default-release”)
  • In this directory, move the logins.json file outside the directory (i.e to your desktop).
  • Begin Import in the DDG browser
  • Select Firefox, Bookmarks and Passwords
  • Observe Bookmarks succeeds
  • Observe Passwords could not be found, “We couldn’t find any passwords.”
  • Observe the bottom right button displays “Skip passwords”
  • Select “Skip passwords”
  • Observe the import dialog is dismissed
  1. Test Firefox No Bookmarks File
  • Go to ~/Library/Application Support/Firefox/Profiles/
  • Locate your active Firefox profile (if you never set up a Firefox profile, it’s likely called something like "ebovof0c.default-release”)
  • In this directory, move the places.sqlite file outside the directory (i.e to your desktop)
  • Ensure that the logins.json file is present (i.e put it back).
  • Begin Import in the DDG browser
  • Select Firefox, Bookmarks and Passwords
  • Observe Passwords succeeds
  • Observe Bookmarks could not be found, “We couldn’t find any bookmarks.”
  • Observe the bottom right button displays “Skip bookmarks”
  • Select “Skip bookmarks”
  • Observe the import dialog is dismissed
  1. Test Chrome No Passwords File
  • Go to ~/Library/Application Support/Google/Chrome/Default/
  • In this directory, move the Login Data and Login Data For Account files outside the directory (i.e to your desktop)
  • Begin Import in the DDG browser
  • Select Chrome, Bookmarks and Passwords
  • Enter your system password when prompted
  • Observe Bookmarks succeeds
  • Observe Passwords could not be found, “We couldn’t find any passwords.”
  • Observe the bottom right button displays “Skip passwords”
  • Select “Skip passwords”
  • Observe the import dialog is dismissed
  1. Test Chrome No Bookmarks File
  • Go to ~/Library/Application Support/Google/Chrome/Default/
  • In this directory, move the Bookmarks file outside the directory (i.e to your desktop)
    • Ensure that the Login Data and Login Data For Account files are present (i.e put it back).
  • Begin Import in the DDG browser
  • Select Chrome, Bookmarks and Passwords
  • Enter your system password when prompted
  • Observe Passwords succeeds
  • Observe Bookmarks could not be found, “We couldn’t find any bookmarks.”
  • Observe the bottom right button displays “Skip bookmarks”
  • Select “Skip bookmarks”
  • Observe the import dialog is dismissed
  1. Test Import Failure Icon
  • Attempt an import from CSV, using the attached CSV
  • On failure, the ’failure’ icon should be displayed for passwords, with the text “Password import failed”

Internal references:

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

@aataraxiaa aataraxiaa changed the title Improve Handling of noData Impot Improve Handling of noData Import Errors Mar 25, 2024
@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 Mar 25, 2024
@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 Mar 28, 2024
@aataraxiaa aataraxiaa marked this pull request as ready for review March 28, 2024 11:09
@@ -29,6 +29,7 @@ final class FirefoxLoginReader {
case couldNotDetermineFormat = -2

case couldNotFindLoginsFile = 0
case couldNotFindKeyDB
Copy link
Collaborator

Choose a reason for hiding this comment

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

please don‘t change the case ordering to keep the original pixel error codes, add the new case to the end of the list, also consider adding a comment to keep the ordering when adding new errors

Comment on lines 83 to 84
case (.bookmarks, .failure(let error)):
if error.errorType == .noData {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this can be split into different cases to remove the nested if: case (.bookmarks, .failure(let error)) where error.errorType == .noData: and case (.bookmarks, .failure(let error)):

Comment on lines 640 to 643
String(format: NSLocalizedString("import.nodata.bookmarks.subtitle", value: "If you have %@ bookmarks, try importing them manually instead.", comment: "Data import error subtitle: suggestion to import Bookmarks manually by selecting a CSV or HTML file."), source.importSourceName)
}
static func importNoDataPasswordsSubtitle(from source: DataImport.Source) -> String {
String(format: NSLocalizedString("import.nodata.passwords.subtitle", value: "If you have %@ passwords, try importing them manually instead.", comment: "Data import error subtitle: suggestion to import passwords manually by selecting a CSV or HTML file."), source.importSourceName)
Copy link
Collaborator

Choose a reason for hiding this comment

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

consider adding a comment for translator what is "%@" here,

BTW, will localization of the added copy be run as a follow-up task or is it in progress?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This updated copy was added as part of ship review and the copy review is still open. Once approved I’ll run translation as part of this task.

@aataraxiaa
Copy link
Contributor Author

Thanks for the review @mallexxx. PR updated.

@mallexxx mallexxx self-assigned this Apr 2, 2024
+ Text(zeroString).bold()
}

case (.bookmarks, .failure(let error)):
Copy link
Collaborator

Choose a reason for hiding this comment

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

fix the 'error' was never used warning

HStack {
skippedImage()
Text("Bookmarks:",
comment: "Data import summary format of how many bookmarks (%lld) were successfully imported.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

fix the comment (no formatting here)

HStack {
skippedImage()
Text("Passwords:",
comment: "Data import summary format of how many passwords (%lld) were successfully imported.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

fix the comment (no formatting here)

Copy link
Collaborator

@mallexxx mallexxx left a comment

Choose a reason for hiding this comment

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

LGTM!
see couple more minor notes about locatization comments above

@mallexxx mallexxx assigned aataraxiaa and unassigned mallexxx Apr 2, 2024
@aataraxiaa aataraxiaa merged commit 26dfe3f into main Apr 4, 2024
17 checks passed
@aataraxiaa aataraxiaa deleted the pete/improve-nodata-error-handling branch April 4, 2024 09:54
samsymons pushed a commit that referenced this pull request Apr 5, 2024
Task/Issue URL: https://app.asana.com/0/0/1206886138223455/f

**Description**:
Stop prompting the user for feedback when we are handling a noData
error. When no data is found initially, and user chooses to skip manual
import, no summary screen is displayed (the import dialog is dismissed)
samsymons added a commit that referenced this pull request Apr 8, 2024
* main: (338 commits)
  Fixes the VPN restarting logic on update (#2545)
  fix download save panel disappearing on navigation (#2549)
  Add CI support for handling installation attribution (#2502)
  Bump version to 1.82.0 (152)
  Pixel changed in subscription (#2541)
  add LSHandlerRank for .duckload document type (#2537)
  Fix usertext comment to ensure it matches localizable string (#2546)
  Update Neighbor Report (#2542)
  DBP: Compare by url and not name (#2544)
  DBP: Compare by url and not name (#2544)
  Adds a series of UI tests for Bookmarks Bar visibility
  Improve Handling of noData Import Errors (#2494)
  Bump version to 1.82.0 (151)
  Use the default action button style for VPN onboarding (#2529)
  Redirect from purchase page to macOS native purchase flow (#2538)
  Closing empty tabs after download (#2510)
  Add Web UI loading state pixels (#2531)
  fix localization warnings (#2288)
  Select URL in address bar when editing and use cmd+L (#2536)
  Add attemptId to Captcha /result endpoint (#2530)
  ...
samsymons added a commit that referenced this pull request Apr 8, 2024
* main: (22 commits)
  Removes last instance of NETWORK_PROTECTION flag (#2573)
  Bye bye NETWORK_PROTECTION (#2509)
  QWD: Enable Hide/Show for Autofill Credit Card Number and CVV (#2539)
  Removed the VPN waitlist beta pixels (#2555)
  VPN: Cleanup authorize call (#2565)
  Revert "VPN: Cleanup authorize call (#2553)"
  VPN: Cleanup authorize call (#2553)
  Improves underlying error pixel information (#2543)
  Fixes the VPN restarting logic on update (#2545)
  fix download save panel disappearing on navigation (#2549)
  Add CI support for handling installation attribution (#2502)
  Fix usertext comment to ensure it matches localizable string (#2546)
  Update Neighbor Report (#2542)
  DBP: Compare by url and not name (#2544)
  Adds a series of UI tests for Bookmarks Bar visibility
  Improve Handling of noData Import Errors (#2494)
  Use the default action button style for VPN onboarding (#2529)
  Closing empty tabs after download (#2510)
  Add Web UI loading state pixels (#2531)
  fix localization warnings (#2288)
  ...
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