diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index 4e48109b4f..83926da830 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -552,11 +552,17 @@ extension Pixel { case syncFailedToMigrate case syncFailedToLoadAccount case syncFailedToSetupEngine - case syncBookmarksCountLimitExceededDaily - case syncCredentialsCountLimitExceededDaily + case syncBookmarksObjectLimitExceededDaily + case syncCredentialsObjectLimitExceededDaily case syncBookmarksRequestSizeLimitExceededDaily case syncCredentialsRequestSizeLimitExceededDaily - + case syncBookmarksTooManyRequestsDaily + case syncCredentialsTooManyRequestsDaily + case syncSettingsTooManyRequestsDaily + case syncBookmarksValidationErrorDaily + case syncCredentialsValidationErrorDaily + case syncSettingsValidationErrorDaily + case syncSentUnauthenticatedRequest case syncMetadataCouldNotLoadDatabase case syncBookmarksFailed @@ -1250,11 +1256,17 @@ extension Pixel.Event { case .syncFailedToMigrate: return "m_d_sync_failed_to_migrate" case .syncFailedToLoadAccount: return "m_d_sync_failed_to_load_account" case .syncFailedToSetupEngine: return "m_d_sync_failed_to_setup_engine" - case .syncBookmarksCountLimitExceededDaily: return "m_d_sync_bookmarks_count_limit_exceeded_daily" - case .syncCredentialsCountLimitExceededDaily: return "m_d_sync_credentials_count_limit_exceeded_daily" - case .syncBookmarksRequestSizeLimitExceededDaily: return "m_d_sync_bookmarks_request_size_limit_exceeded_daily" - case .syncCredentialsRequestSizeLimitExceededDaily: return "m_d_sync_credentials_request_size_limit_exceeded_daily" - + case .syncBookmarksObjectLimitExceededDaily: return "m_sync_bookmarks_object_limit_exceeded_daily" + case .syncCredentialsObjectLimitExceededDaily: return "m_sync_credentials_object_limit_exceeded_daily" + case .syncBookmarksRequestSizeLimitExceededDaily: return "m_sync_bookmarks_request_size_limit_exceeded_daily" + case .syncCredentialsRequestSizeLimitExceededDaily: return "m_sync_credentials_request_size_limit_exceeded_daily" + case .syncBookmarksTooManyRequestsDaily: return "m_sync_bookmarks_too_many_requests_daily" + case .syncCredentialsTooManyRequestsDaily: return "m_sync_credentials_too_many_requests_daily" + case .syncSettingsTooManyRequestsDaily: return "m_sync_settings_too_many_requests_daily" + case .syncBookmarksValidationErrorDaily: return "m_sync_bookmarks_validation_error_daily" + case .syncCredentialsValidationErrorDaily: return "m_sync_credentials_validation_error_daily" + case .syncSettingsValidationErrorDaily: return "m_sync_settings_validation_error_daily" + case .syncSentUnauthenticatedRequest: return "m_d_sync_sent_unauthenticated_request" case .syncMetadataCouldNotLoadDatabase: return "m_d_sync_metadata_could_not_load_database" case .syncBookmarksFailed: return "m_d_sync_bookmarks_failed" diff --git a/Core/SyncErrorHandler.swift b/Core/SyncErrorHandler.swift index 025a3abfcb..ec929c8fbd 100644 --- a/Core/SyncErrorHandler.swift +++ b/Core/SyncErrorHandler.swift @@ -208,10 +208,12 @@ extension SyncErrorHandler { case .settings: break } + DailyPixel.fire(pixel: modelType.badRequestPixel) case .unexpectedStatusCode(401): syncIsPaused(errorType: .invalidLoginCredentials) case .unexpectedStatusCode(418), .unexpectedStatusCode(429): syncIsPaused(errorType: .tooManyRequests) + DailyPixel.fire(pixel: modelType.tooManyRequestsPixel) default: break } @@ -223,11 +225,11 @@ extension SyncErrorHandler { case .bookmarksCountLimitExceeded: currentSyncBookmarksPausedError = errorType.rawValue self.isSyncBookmarksPaused = true - DailyPixel.fire(pixel: .syncBookmarksCountLimitExceededDaily) + DailyPixel.fire(pixel: .syncBookmarksObjectLimitExceededDaily) case .credentialsCountLimitExceeded: currentSyncCredentialsPausedError = errorType.rawValue self.isSyncCredentialsPaused = true - DailyPixel.fire(pixel: .syncCredentialsCountLimitExceededDaily) + DailyPixel.fire(pixel: .syncCredentialsObjectLimitExceededDaily) case .bookmarksRequestSizeLimitExceeded: currentSyncBookmarksPausedError = errorType.rawValue self.isSyncBookmarksPaused = true @@ -305,6 +307,28 @@ extension SyncErrorHandler { .syncSettingsPatchCompressionFailed } } + + var tooManyRequestsPixel: Pixel.Event { + switch self { + case .bookmarks: + .syncBookmarksTooManyRequestsDaily + case .credentials: + .syncCredentialsTooManyRequestsDaily + case .settings: + .syncSettingsTooManyRequestsDaily + } + } + + var badRequestPixel: Pixel.Event { + switch self { + case .bookmarks: + .syncBookmarksValidationErrorDaily + case .credentials: + .syncCredentialsValidationErrorDaily + case .settings: + .syncSettingsValidationErrorDaily + } + } } }