Skip to content

Commit

Permalink
Merge branch 'main' into graeme/sanitize-location-selection
Browse files Browse the repository at this point in the history
# By bwaresiak (6) and others
# Via Bartek Waresiak (1) and others
* main: (30 commits)
  Update VPN support copy (#2894)
  Settings experiment disabled and new Settings rolled out to all users (#2904)
  Release 7.122.0-2 (#2909)
  PrivacyPro terms of service link (#2907)
  Release 7.122.0-1 (#2906)
  Fix release branch VPN auth issues (#2903)
  Disable the autofill survey (#2899)
  fire RMF message updated notification if we make any change to the store (#2891)
  Fix maestro config so it runs (#2896)
  Disable the autofill survey (#2899)
  Release 7.122.0-0 (#2898)
  Do not refresh collection view when we are changing the display mode (#2895)
  Add option to crash the app with exception from debug menu (#2897)
  Remove default.profraw (#2893)
  Guard swipe tabs scroll state (#2888)
  Add debug pixels for data cleanup (#2890)
  Bump rexml from 3.2.6 to 3.2.8 (#2866)
  Remove VPN waitlist code (#2795)
  Privacy Pro Follow ups (#2882)
  Clean up subscriptionFeature on init (#2880)
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
  • Loading branch information
samsymons committed Jun 1, 2024
2 parents e99fdb7 + af1e587 commit bb379d0
Show file tree
Hide file tree
Showing 233 changed files with 5,293 additions and 4,364 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/sync-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
name: Sync End To End Tests
needs: build-for-sync-end-to-end-tests
runs-on: macos-13-xlarge
timeout-minutes: 60
timeout-minutes: 90
strategy:
matrix:
os-version: [15, 16, 17]
Expand All @@ -92,20 +92,25 @@ jobs:
name: duckduckgo-ios-app
path: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app

- name: Install Maestro
run: |
export MAESTRO_VERSION=1.36.0; curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Overwrite default config with sync one
run: |
cp .maestro/config-sync .maestro/config.yaml
- name: Sync e2e tests
uses: mobile-dev-inc/[email protected]
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app
ios-version: ${{ matrix.os-version }}
workspace: .maestro
include-tags: sync
env: |
CODE=${{ steps.sync-recovery-code.outputs.recovery-code }}
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/
- name: Reset config
run: |
git checkout .maestro/config.yaml
notify-failure:
name: Notify on failure
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') }}
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && github.ref_name == 'main' }}
needs: [build-for-sync-end-to-end-tests, sync-end-to-end-tests]
runs-on: ubuntu-latest

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ Configuration/ExternalDeveloper.xcconfig
scripts/assets

DuckDuckGoTests/NetworkProtectionVPNLocationViewModelTests.swift*.plist
*.profraw
68 changes: 68 additions & 0 deletions .maestro/browser_features/swipe_tabs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# swipe_tabs.yaml
appId: com.duckduckgo.mobile.ios
tags:
- release

---

# Set up
- clearState
- launchApp
- runFlow:
when:
visible:
text: "Let’s Do It!"
index: 0
file: ../shared/onboarding.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.search-company.site"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible: "Search engine"

# Open New Tab
- tapOn: "Tab Switcher"
- tapOn:
id: Add

# Perform a search
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://privacy-test-pages.site/features/favicon/"
- pressKey: Enter

- assertVisible: "Favicon Tests"

# Swipe to first tab
- swipe:
start: 10%, 10%
end: 90%, 10%

- assertVisible: "Search engine"

# Ensure address bar still works
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://privacy-test-pages.site/features/download/"
- pressKey: Enter

- assertVisible: "Download PDF"

# TODO when settings experiment finishes update this test to open settings and move bar to bottom then test swipe again
15 changes: 15 additions & 0 deletions .maestro/config-sync
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
appStartup:
enabled: false
appSize:
enabled: false
flows:
- "**"
executionOrder:
flowsOrder:
- 01_create_account
- 02_login_account
- 03_recover_account
- 04_sync_data_setup
- 05_sync_data_check
- 06_delete_account

3 changes: 2 additions & 1 deletion .maestro/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ appStartup:
appSize:
enabled: false
flows:
- "**"
- "**"

1 change: 1 addition & 0 deletions .maestro/sync_tests/01_create_account.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
appId: com.duckduckgo.mobile.ios
tags:
- sync
name: 01_create_account

---

Expand Down
1 change: 1 addition & 0 deletions .maestro/sync_tests/02_login_account.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
appId: com.duckduckgo.mobile.ios
tags:
- sync
name: 02_login_account

---

Expand Down
1 change: 1 addition & 0 deletions .maestro/sync_tests/03_recover_account.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
appId: com.duckduckgo.mobile.ios
tags:
- sync
name: 03_recover_account

---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
appId: com.duckduckgo.mobile.ios
tags:
- sync
name: 04_sync_data_setup

---

Expand Down Expand Up @@ -65,25 +66,6 @@ tags:
- runFlow:
file: ../shared/remove_local_logins.yaml

# Login
- tapOn: Settings
- tapOn: Sync & Backup
- runFlow:
file: ../shared/sync_login.yaml

# Verify bookmarks have been merged
- tapOn: Settings
- runFlow:
file: ../shared/sync_verify_bookmarks.yaml

# Verify favorites are unified
- tapOn: Done
- tapOn: Settings
- runFlow:
file: ../shared/sync_verify_unified_favorites.yaml

# Verify logins
- tapOn: Settings
- runFlow:
file: ../shared/sync_verify_logins.yaml

# Maestro seems to get stuck without an additional step here
- assertVisible:
id: searchEntry
56 changes: 56 additions & 0 deletions .maestro/sync_tests/05_sync_data_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
appId: com.duckduckgo.mobile.ios
tags:
- sync
name: 05_sync_data_check

---
# IMPORTANT: This test is strictly related to 04_sync_data_setup
# and it will fail if 04 is not executed before.
# The test is split in two different flow to accomodate
# for Maestro CI max execution time.
# Clear and launch
- clearState
- launchApp

# Run onboarding Flow
- runFlow:
when:
visible:
text: "Let’s Do It!"
index: 0
file: ../shared/onboarding.yaml

# Copy Recovery Code
- tapOn: Settings
- runFlow:
file: ../shared/copy_recovery_code_from_settings.yaml
env:
CODE: ${CODE}

# Set Internal User
- runFlow:
file: ../shared/set_internal_user_from_settings.yaml

# Login
- assertVisible: Sync & Backup
- tapOn: Sync & Backup
- runFlow:
file: ../shared/sync_login.yaml
- assertVisible: Sync & Backup

# Verify bookmarks have been merged
- tapOn: Settings
- runFlow:
file: ../shared/sync_verify_bookmarks.yaml

# Verify favorites are unified
- tapOn: Done
- tapOn: Settings
- runFlow:
file: ../shared/sync_verify_unified_favorites.yaml

# Verify logins
- tapOn: Settings
- runFlow:
file: ../shared/sync_verify_logins.yaml

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
appId: com.duckduckgo.mobile.ios
tags:
- sync

name: 06_delete_account
---

# Clear and launch
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 7.121.0
MARKETING_VERSION = 7.122.0
4 changes: 2 additions & 2 deletions Core/AppPrivacyConfigurationDataProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import BrowserServicesKit
final public class AppPrivacyConfigurationDataProvider: EmbeddedDataProvider {

public struct Constants {
public static let embeddedDataETag = "\"e9c1178b9f9d725dd3f182c7847e848b\""
public static let embeddedDataSHA = "c64ce5c56a9cd93b5479f4997b34835992d06f85b5a00e2df5b8b3fde1796369"
public static let embeddedDataETag = "\"81e5722b1fef45e0e8f0332b500d12d8\""
public static let embeddedDataSHA = "e0f7b8e519cb818fdf512e0ee9251f176f1ed6ed283d2b6c865f264e23eae377"
}

public var embeddedDataEtag: String {
Expand Down
4 changes: 2 additions & 2 deletions Core/AppTrackerDataSetProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import BrowserServicesKit
final public class AppTrackerDataSetProvider: EmbeddedDataProvider {

public struct Constants {
public static let embeddedDataETag = "\"004872ea25514c61490f047cd5f088b8\""
public static let embeddedDataSHA = "4a06a3df999fad7829baecc9ccfcbc54c20526ba304f6c5f2846899d29b281cc"
public static let embeddedDataETag = "\"ea184137cdaa19ca5de76352215a9e0e\""
public static let embeddedDataSHA = "faa4dfbef4903710374b153c9a87e09b713fc19d64fa0bcfd1fd392fff93af21"
}

public var embeddedDataEtag: String {
Expand Down
12 changes: 11 additions & 1 deletion Core/DataStoreWarmup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,21 @@ import WebKit
/// WKWebsiteDataStore is basically non-functional until a web view has been instanciated and a page is successfully loaded.
public class DataStoreWarmup {

public enum ApplicationState: String {
case active
case inactive
case background
case handlingShortcut
case unknown
}

public init() { }

@MainActor
public func ensureReady() async {
public func ensureReady(applicationState: ApplicationState) async {
Pixel.fire(pixel: .webkitWarmupStart(appState: applicationState.rawValue))
await BlockingNavigationDelegate().loadInBackgroundWebView(url: URL(string: "about:blank")!)
Pixel.fire(pixel: .webkitWarmupFinished(appState: applicationState.rawValue))
}

}
Expand Down
5 changes: 3 additions & 2 deletions Core/DefaultVariantManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ extension FeatureName {
// public static let experimentalFeature = FeatureName(rawValue: "experimentalFeature")

public static let history = FeatureName(rawValue: "history")
public static let newSuggestionLogic = FeatureName(rawValue: "newSuggestionLogic")
}

public struct VariantIOS: Variant {
Expand Down Expand Up @@ -62,7 +61,9 @@ public struct VariantIOS: Variant {
VariantIOS(name: "sc", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "sd", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "se", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "mc", weight: doNotAllocate, isIncluded: When.inEnglish, features: [.newSuggestionLogic]),

// This needs to stay until we finish rolling out history to all users...
// This ensures that users who previously had do not lose it.
VariantIOS(name: "md", weight: doNotAllocate, isIncluded: When.inEnglish, features: [.history]),

returningUser
Expand Down
5 changes: 4 additions & 1 deletion Core/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public enum FeatureFlag: String {
case networkProtectionWaitlistActive
case autoconsentOnByDefault
case history
case historyRollout
}

extension FeatureFlag: FeatureFlagSourceProviding {
Expand Down Expand Up @@ -68,7 +69,9 @@ extension FeatureFlag: FeatureFlagSourceProviding {
return .remoteReleasable(.subfeature(AutoconsentSubfeature.onByDefault))
case .history:
return .remoteReleasable(.feature(.history))

case .historyRollout:
return .remoteReleasable(.subfeature(HistorySubFeature.onByDefault))

}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Core/HistoryCapture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ public class HistoryCapture {
}

public func webViewDidCommit(url: URL) {
let url = url.urlOrDuckDuckGoCleanQuery
self.url = url
coordinator.addVisit(of: url)
}

public func titleDidChange(_ title: String?, forURL url: URL?) {
guard let url, self.url == url else {
guard let url = url?.urlOrDuckDuckGoCleanQuery, self.url == url else {
return
}

Expand Down
Loading

0 comments on commit bb379d0

Please sign in to comment.