Skip to content

Commit

Permalink
Validate correct environment (#2546)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/0/1206645876801807/f
Tech Design URL:
CC:

Description:

Fire Unique pixel in case we are on dev environment but we most likely should not be.
  • Loading branch information
bwaresiak authored Mar 6, 2024
1 parent 28c56c6 commit 5405554
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ extension Pixel {
case syncRemoveDeviceError
case syncDeleteAccountError
case syncLoginExistingAccountError
case syncWrongEnvironment

case swipeTabsUsed
case swipeTabsUsedDaily
Expand Down Expand Up @@ -1004,6 +1005,8 @@ extension Pixel.Event {
case .syncDeleteAccountError: return "m_d_sync_delete_account_error"
case .syncLoginExistingAccountError: return "m_d_sync_login_existing_account_error"

case .syncWrongEnvironment: return "m_d_sync_wrong_environment_u"

case .swipeTabsUsed: return "m_swipe-tabs-used"
case .swipeTabsUsedDaily: return "m_swipe-tabs-used-daily"

Expand Down
4 changes: 4 additions & 0 deletions DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
guard !testing else { return }

syncService.initializeIfNeeded()
if syncService.authState == .active &&
(InternalUserStore().isInternalUser == false && syncService.serverEnvironment == .development) {
UniquePixel.fire(pixel: .syncWrongEnvironment)
}
syncDataProviders.setUpDatabaseCleanersIfNeeded(syncService: syncService)

if !(overlayWindow?.rootViewController is AuthenticationViewController) {
Expand Down

0 comments on commit 5405554

Please sign in to comment.