Skip to content

Commit

Permalink
Merge branch 'main' into sam/vpn-snooze-initial-support
Browse files Browse the repository at this point in the history
# By Christopher Brind (3) and others
# Via Anh Do (1) and GitHub (1)
* main:
  Add connection tester failure pixels (#3049)
  Release 7.127.0-1 (#3051)
  fix bug not clearing ui properly on autoclear (#3050)
  widget UI tests (#3042)
  fix autofill widget failure (#3040)
  macOS BSK change: De-duplicate passwords on import (#3048)
  Privacy Dashboard refactor (#3038)
  Make Maestro tests fail on flow cancellation (#3036)
  Improve VPN logging logic (#3032)
  Subscription refactoring #5 (#3023)
  Update Sync error pixels (#3046)
  Fixes App Data Clearing State Status In Settings (#3041)
  update sync error copy (#2870)
  Fixes for Xcode 16 (BSK -> 164.3.0) (#3035)
  Update the Privacy Pro status attribute matcher (#3033)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
  • Loading branch information
samsymons committed Jul 7, 2024
2 parents 171227e + 094fdf3 commit 4167d6f
Show file tree
Hide file tree
Showing 80 changed files with 934 additions and 985 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ jobs:
- name: Release tests
run: |
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --timeout=150 --ios-version=17 --include-tags=release DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=release DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
- name: Privacy tests
run: |
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --timeout=150 --ios-version=17 --include-tags=privacy DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=privacy DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
- name: Security tests
run: |
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --timeout=150 --ios-version=17 --include-tags=securityTest DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=securityTest DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
- name: Ad Click Detection Flow tests
run: |
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --timeout=150 --ios-version=17 --include-tags=adClick DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=adClick DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
- name: Create Asana task when workflow failed
if: ${{ failure() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Sync e2e tests
run: |
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --env=CODE=${{ steps.sync-recovery-code.outputs.recovery-code }} --fail-on-timeout=true --timeout=150 --ios-version=${{ matrix.os-version }} --include-tags=sync DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --env=CODE=${{ steps.sync-recovery-code.outputs.recovery-code }} --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=${{ matrix.os-version }} --include-tags=sync DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
- name: Reset config
run: |
Expand Down
39 changes: 19 additions & 20 deletions .maestro/release_tests/password-authentication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,22 @@ tags:
- tapOn: "Done"

# Validate launch from widget

- pressKey: HOME
- longPressOn:
point: 50%,50%
- tapOn: "Add Widget"
- tapOn: Search Widgets
- inputText: DuckDuck
- tapOn: DuckDuckGo
- tapOn: "Page 1 of 5"
- tapOn: " Add Widget"
- tapOn: "Done"
- tapOn:
id: "DuckDuckGo"
index: 0

- assertVisible: "Unlock device to access passwords"
- inputText: "Anything"
- pressKey: Enter
- assertVisible: "Search passwords"

# Disabled until we can get iOS 17.2 runner on mobile.dev (or our own CI)
# - pressKey: HOME
# - longPressOn:
# point: 50%,50%
# - tapOn: "Add Widget"
# - tapOn: "Search Widgets"
# - inputText: "DuckDuck"
# - tapOn: "DuckDuckGo"
# - tapOn: "Page 1 of 5"
# - tapOn: " Add Widget"
# - tapOn: "Done"
# - tapOn:
# id: "DuckDuckGo"
# index: 0

# - assertVisible: "Unlock device to access passwords"
# - inputText: "Anything"
# - pressKey: Enter
# - assertVisible: "Search passwords"
77 changes: 77 additions & 0 deletions .maestro/release_tests/widgets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# widgets.yaml
appId: com.duckduckgo.mobile.ios

# Disabled until we can support iOS 17.2 on CI
# tags:
# - release

---

# Set up
- clearState
- launchApp
- runFlow:
file: ../shared/onboarding.yaml

# Load a website
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://privacy-test-pages.site/"
- pressKey: Enter

# Manage onboarding
- runFlow:
file: ../shared/onboarding_browsing.yaml

# Prepare to add widgets
- pressKey: HOME

# Swipe to first page to get from the app (removing the app from home screen doesn't work)
- swipe:
start: 5%, 70%
end: 95%, 70%

# Validate search widget
- longPressOn:
point: 50%,50%
- tapOn: "Add Widget"
- tapOn: "Search Widgets"
- inputText: "DuckDuck"
- tapOn: "DuckDuckGo"
- tapOn: " Add Widget"
- tapOn: "Done"
- tapOn: "DuckDuckGo"
- inputText: "example.com"
- pressKey: Enter
- assertVisible: "Example Domain"
- assertVisible: "Tab Switcher"
- tapOn: "Tab Switcher"
- assertVisible: "Open \"Privacy Test Pages - Home\" at privacy-test-pages.site"

# Validate favorites widget
- pressKey: HOME
- longPressOn:
point: 50%,50%
- tapOn: "Add Widget"
- tapOn: "Search Widgets"
- inputText: "DuckDuck"
- tapOn: "DuckDuckGo"
- assertVisible: "Search"
- swipe:
start: 90%, 50%
end: 10%, 50%
- assertVisible: "Search Passwords"
- swipe:
start: 90%, 50%
end: 10%, 50%
- assertVisible: "Search and Favorites"
- swipe:
start: 90%, 50%
end: 10%, 50%
- assertVisible: "Search and Favorites"
- swipe:
start: 90%, 50%
end: 10%, 50%
- assertVisible: "VPN"
2 changes: 1 addition & 1 deletion .maestro/setup_ui_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source $(dirname $0)/common.sh

# The simulator command requires the hyphens
target_device="iPhone-15"
target_os="iOS-17-2"
target_os="iOS-17-0"

## Functions

Expand Down
11 changes: 0 additions & 11 deletions Core/ContentBlocking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public final class ContentBlocking {
embeddedDataProvider: AppPrivacyConfigurationDataProvider(),
localProtection: DomainsProtectionUserDefaultsStore(),
errorReporting: Self.debugEvents,
toggleProtectionsCounterEventReporting: toggleProtectionsEvents,
internalUserDecider: internalUserDecider,
installDate: statisticsStore.installDate)
self.privacyConfigurationManager = privacyConfigurationManager
Expand Down Expand Up @@ -197,16 +196,6 @@ public final class ContentBlocking {
Pixel.fire(pixel: domainEvent, includedParameters: [])
}

private let toggleProtectionsEvents = EventMapping<ToggleProtectionsCounterEvent> { event, _, parameters, _ in
let domainEvent: Pixel.Event
switch event {
case .toggleProtectionsCounterDaily:
domainEvent = .toggleProtectionsDailyCount
}

Pixel.fire(pixel: domainEvent, withAdditionalParameters: parameters ?? [:])
}

}

public class DomainsProtectionUserDefaultsStore: DomainsProtectionStore {
Expand Down
59 changes: 29 additions & 30 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,11 @@ extension Pixel {
case networkProtectionServerMigrationAttemptSuccess
case networkProtectionServerMigrationAttemptFailure

case networkProtectionConnectionTesterFailureDetected
case networkProtectionConnectionTesterFailureRecovered(failureCount: Int)
case networkProtectionConnectionTesterExtendedFailureDetected
case networkProtectionConnectionTesterExtendedFailureRecovered(failureCount: Int)

case networkProtectionTunnelFailureDetected
case networkProtectionTunnelFailureRecovered

Expand Down Expand Up @@ -552,11 +557,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
Expand Down Expand Up @@ -608,17 +619,7 @@ extension Pixel {
case toggleReportDismiss

case userBehaviorReloadTwiceWithin12Seconds
case userBehaviorReloadTwiceWithin24Seconds
case userBehaviorReloadAndRestartWithin30Seconds
case userBehaviorReloadAndRestartWithin50Seconds
case userBehaviorReloadThreeTimesWithin20Seconds
case userBehaviorReloadThreeTimesWithin40Seconds

case siteNotWorkingShown
case siteNotWorkingDismiss
case siteNotWorkingDismissByNavigation
case siteNotWorkingDismissByRefresh
case siteNotWorkingWebsiteIsBroken

// MARK: History
case historyStoreLoadFailed
Expand Down Expand Up @@ -1047,6 +1048,10 @@ extension Pixel.Event {
case .networkProtectionEnableAttemptConnecting: return "m_netp_ev_enable_attempt"
case .networkProtectionEnableAttemptSuccess: return "m_netp_ev_enable_attempt_success"
case .networkProtectionEnableAttemptFailure: return "m_netp_ev_enable_attempt_failure"
case .networkProtectionConnectionTesterFailureDetected: return "m_netp_connection_tester_failure"
case .networkProtectionConnectionTesterFailureRecovered: return "m_netp_connection_tester_failure_recovered"
case .networkProtectionConnectionTesterExtendedFailureDetected: return "m_netp_connection_tester_extended_failure"
case .networkProtectionConnectionTesterExtendedFailureRecovered: return "m_netp_connection_tester_extended_failure_recovered"
case .networkProtectionTunnelFailureDetected: return "m_netp_ev_tunnel_failure"
case .networkProtectionTunnelFailureRecovered: return "m_netp_ev_tunnel_failure_recovered"
case .networkProtectionLatency(let quality): return "m_netp_ev_\(quality.rawValue)_latency"
Expand Down Expand Up @@ -1250,11 +1255,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"
Expand Down Expand Up @@ -1315,19 +1326,7 @@ extension Pixel.Event {

// MARK: - User behavior
case .userBehaviorReloadTwiceWithin12Seconds: return "m_reload-twice-within-12-seconds"
case .userBehaviorReloadTwiceWithin24Seconds: return "m_reload-twice-within-24-seconds"

case .userBehaviorReloadAndRestartWithin30Seconds: return "m_reload-and-restart-within-30-seconds"
case .userBehaviorReloadAndRestartWithin50Seconds: return "m_reload-and-restart-within-50-seconds"

case .userBehaviorReloadThreeTimesWithin20Seconds: return "m_reload-three-times-within-20-seconds"
case .userBehaviorReloadThreeTimesWithin40Seconds: return "m_reload-three-times-within-40-seconds"

case .siteNotWorkingShown: return "m_site-not-working_shown"
case .siteNotWorkingDismiss: return "m_site-not-working_dismiss"
case .siteNotWorkingDismissByNavigation: return "m_site-not-working_dismiss-by-navigation"
case .siteNotWorkingDismissByRefresh: return "m_site-not-working_dismiss-by-refresh"
case .siteNotWorkingWebsiteIsBroken: return "m_site-not-working_website-is-broken"

// MARK: - History debug
case .historyStoreLoadFailed: return "m_debug_history-store-load-failed"
Expand Down
3 changes: 2 additions & 1 deletion Core/SyncDataProviders.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public class SyncDataProviders: DataProvidersSource {
credentialsAdapter = SyncCredentialsAdapter(secureVaultFactory: secureVaultFactory,
secureVaultErrorReporter: secureVaultErrorReporter,
syncErrorHandler: syncErrorHandler)
settingsAdapter = SyncSettingsAdapter(settingHandlers: settingHandlers)
settingsAdapter = SyncSettingsAdapter(settingHandlers: settingHandlers,
syncErrorHandler: syncErrorHandler)
}

private func initializeMetadataDatabaseIfNeeded() {
Expand Down
Loading

0 comments on commit 4167d6f

Please sign in to comment.