Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit 66c516a

Browse files
authored
Send pixel on sync secure storage read failure (#3530)
Task/Issue URL: https://app.asana.com/0/1201493110486074/1208686320819590/f **Description**: On investigating a hard-to-reproduce issue with sync, I noticed there's a gap in error reporting when the secure storage (keychain) is not available. This adds a pixel for that case. **Steps to test this PR**: Just a pixel in an error case. Hard to test without altering code. But if you do want to do that: 1. Enable sync 2. Change `BSK.DDGSync.SecureStorage.account()` to throw every time 3. Go to the Settings -> Sync screen 4. You should see the `sync_secure_storage_read_error` Pixel in the debug console **Definition of Done (Internal Only)**: * [ ] Does this PR satisfy our [Definition of Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)? **Copy Testing**: * [ ] Use of correct apostrophes in new copy, ie `’` rather than `'` **Orientation Testing**: * [ ] Portrait * [ ] Landscape **Device Testing**: * [ ] iPhone SE (1st Gen) * [ ] iPhone 8 * [ ] iPhone X * [ ] iPhone 14 Pro * [ ] iPad **OS Testing**: * [ ] iOS 15 * [ ] iOS 16 * [ ] iOS 17 **Theme Testing**: * [ ] Light theme * [ ] Dark theme --- ###### Internal references: [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943)
1 parent b1cb778 commit 66c516a

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

Core/PixelEvent.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ extension Pixel {
624624
case syncRemoveDeviceError
625625
case syncDeleteAccountError
626626
case syncLoginExistingAccountError
627+
case syncSecureStorageReadError
627628

628629
case syncGetOtherDevices
629630
case syncGetOtherDevicesCopy
@@ -1432,6 +1433,7 @@ extension Pixel.Event {
14321433
case .syncRemoveDeviceError: return "m_d_sync_remove_device_error"
14331434
case .syncDeleteAccountError: return "m_d_sync_delete_account_error"
14341435
case .syncLoginExistingAccountError: return "m_d_sync_login_existing_account_error"
1436+
case .syncSecureStorageReadError: return "m_d_sync_secure_storage_error"
14351437

14361438
case .syncGetOtherDevices: return "sync_get_other_devices"
14371439
case .syncGetOtherDevicesCopy: return "sync_get_other_devices_copy"

Core/SyncErrorHandler.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ public class SyncErrorHandler: EventMapping<SyncError> {
100100
Pixel.fire(pixel: .syncFailedToLoadAccount, error: error)
101101
case .failedToSetupEngine:
102102
Pixel.fire(pixel: .syncFailedToSetupEngine, error: error)
103+
case .failedToReadSecureStore:
104+
Pixel.fire(pixel: .syncSecureStorageReadError, error: error)
103105
default:
104106
// Should this be so generic?
105107
let domainEvent = Pixel.Event.syncSentUnauthenticatedRequest

DuckDuckGo.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10970,7 +10970,7 @@
1097010970
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
1097110971
requirement = {
1097210972
kind = exactVersion;
10973-
version = 203.1.0;
10973+
version = 203.2.0;
1097410974
};
1097510975
};
1097610976
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {

DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"kind" : "remoteSourceControl",
3333
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
3434
"state" : {
35-
"revision" : "19f1e5c945aa92562ad2d087e8d6c99801edf656",
36-
"version" : "203.1.0"
35+
"revision" : "56dbee74e34d37b6e699921a0b9bce2b8f22711d",
36+
"version" : "203.2.0"
3737
}
3838
},
3939
{

0 commit comments

Comments
 (0)