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

sync error notify user #2712

Merged
merged 30 commits into from
May 10, 2024
Merged

sync error notify user #2712

merged 30 commits into from
May 10, 2024

Conversation

SabrinaTardio
Copy link
Collaborator

@SabrinaTardio SabrinaTardio commented Apr 26, 2024

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

Description: Notify user of more sync errors https://app.asana.com/0/0/1207045332341265/f

Steps to test this PR:
Errors on the menu

  1. Go to the sync menu and check no error is reported
  2. Set up a proxy tool and intercept responses from https://dev-sync-use.duckduckgo.com/sync/bookmarks
  3. Exit and reenter the sync menu intercept the response and change the response code to 400, 401, 409, 413, 418, 429
  4. Check on the sync menu the appropriate error appears.
  5. Check the sync settings menu item shows the danger sign.
  6. Check that clicking on managing bookmarks takes you to the bookmarks manager.
  7. Add a new bookmark
  8. Check that the specific bookmark error disappeared from the sync menu
  9. Do the same for credentials (https://dev-sync-use.duckduckgo.com/sync/credentials) (for step 6 add a credential)

Alerts For errors 400, 401, 409 and 413

  1. check that the first time an alert is displayed warning the user (clicking on ok will dismiss the alert clicking on learn more should lead to the sync settings)
  2. The alert should then not be appear again until a sync event is successful and an error occurs again

Alerts For errors 418 and 429
The alert should only appear if:
The error occurs consecutively (no successful sync is registered in between) 10 times indicating a persistent issue OR
No successful sync (after an error) has occurred in 12 hours.
We will only show the error once a day (if 10 times are hit again within the day we will not show it again)
To test this please use the user default data:
"sync.last-error-notification-time” -> which is a Date
"sync.last-time-success” -> which is a Date
"sync.non-actionable-error-count” -> number of times the error is triggered and is an integer

--

Internal references:

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

Copy link
Contributor

github-actions bot commented Apr 26, 2024

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

Generated by 🚫 dangerJS against 9d887ad

@SabrinaTardio SabrinaTardio changed the title Sabrina/sync error notify sync error notify user Apr 26, 2024
@ayoy ayoy self-requested a review April 29, 2024 08:17
@SabrinaTardio SabrinaTardio marked this pull request as ready for review April 29, 2024 21:19
@ayoy ayoy self-assigned this May 7, 2024
Copy link
Collaborator

@ayoy ayoy left a comment

Choose a reason for hiding this comment

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

@SabrinaTardio I'm leaving a bunch of comments related to naming and code placement.

DuckDuckGo/Common/Utilities/UserDefaultsWrapper.swift Outdated Show resolved Hide resolved
DuckDuckGo/Sync/SyncErrorHandler.swift Outdated Show resolved Hide resolved
DuckDuckGo/Preferences/Model/SyncPreferences.swift Outdated Show resolved Hide resolved
DuckDuckGo/Preferences/Model/SyncPreferences.swift Outdated Show resolved Hide resolved
@SabrinaTardio SabrinaTardio requested a review from ayoy May 8, 2024 19:31
@SabrinaTardio
Copy link
Collaborator Author

@SabrinaTardio I'm leaving a bunch of comments related to naming and code placement.

It is ready to be reviewed again… please not the change in 400 error behaviour that now is expected to behave as 413 and 409

Copy link
Collaborator

@ayoy ayoy left a comment

Choose a reason for hiding this comment

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

Looks great, I'm loving the changes, great job 💪

@ayoy ayoy assigned SabrinaTardio and unassigned ayoy May 9, 2024
@SabrinaTardio SabrinaTardio merged commit d094931 into main May 10, 2024
15 checks passed
@SabrinaTardio SabrinaTardio deleted the sabrina/sync-error-notify branch May 10, 2024 09:25
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