Skip to content

Commit

Permalink
Merge branch 'sam/vpn-ui-improvements' into sam/vpn-ui-improvements-2…
Browse files Browse the repository at this point in the history
…-lottie-animation

* sam/vpn-ui-improvements:
  Update wireguard-apple to 1.1.3 (#2598)
  Updates BSK to include latest changes (#2604)
  Fix VPN feedback form description (#2606)
  Fixes the name of a pixel (#2575)
  22. Subscription- Cleanup and minor updates (#2596)
  Release 7.112.0-3 (#2602)
  update embedded file
  Bump autoconsent to 10.3.0 (#2601)
  Roll back CPM post-rollout cleanup (#2599)
  Stub objects for Bookmarks DB (#2593)
  Subscriptions - 21. Manage Billing options to third parties (#2574)
  17. Subscription Review Fixes (#2547)
  bump bsk to fix retain cycle (#2595)
  New log for SKAd 4 integration (#2594)
  NetP x Subscription Clean-up (#2565)
  Update BSK to include latest macOS changes (#2588)
  • Loading branch information
samsymons committed Mar 18, 2024
2 parents f0898f9 + 92e1f65 commit c0117b6
Show file tree
Hide file tree
Showing 55 changed files with 1,629 additions and 810 deletions.
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 = "\"73cfb8d6f397fd1de921f057db1bcc44\""
public static let embeddedDataSHA = "3debb4a1e5c6cc292b3c03d9ea6ce4daa8073ab0c033131f2f8dbe1f752dfaf1"
public static let embeddedDataETag = "\"c595f46fe54bfa96bbff4f30fc3940d8\""
public static let embeddedDataSHA = "911e6616b6869c0940c492240d43c0cf60274755dd45a50cc635c8b7c792cb87"
}

public var embeddedDataEtag: String {
Expand Down
5 changes: 3 additions & 2 deletions Core/BookmarksCachingSearch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ public class CoreDataBookmarksSearchStore: BookmarksSearchStore {

let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "BookmarkEntity")
fetchRequest.predicate = NSPredicate(
format: "%K = false AND %K == NO",
format: "%K = false AND %K == NO AND (%K == NO OR %K == nil)",
#keyPath(BookmarkEntity.isFolder),
#keyPath(BookmarkEntity.isPendingDeletion)
#keyPath(BookmarkEntity.isPendingDeletion),
#keyPath(BookmarkEntity.isStub), #keyPath(BookmarkEntity.isStub)
)
fetchRequest.resultType = .dictionaryResultType
fetchRequest.propertiesToFetch = [#keyPath(BookmarkEntity.title),
Expand Down
40 changes: 0 additions & 40 deletions Core/BundleExtensions.swift

This file was deleted.

3 changes: 3 additions & 0 deletions Core/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public enum FeatureFlag: String {
case networkProtectionWaitlistActive
case subscription
case swipeTabs
case autoconsentOnByDefault
case history
}

Expand Down Expand Up @@ -66,6 +67,8 @@ extension FeatureFlag: FeatureFlagSourceProviding {
return .remoteReleasable(.subfeature(AutofillSubfeature.onByDefault))
case .incontextSignup:
return .remoteReleasable(.feature(.incontextSignup))
case .autoconsentOnByDefault:
return .remoteReleasable(.subfeature(AutoconsentSubfeature.onByDefault))
case .history:
return .remoteReleasable(.feature(.history))
}
Expand Down
51 changes: 41 additions & 10 deletions Core/Pixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,14 @@ public class Pixel {
case atb
case appVersion
}


private enum Constant {
static let pixelStorageIdentifier = "com.duckduckgo.pixel.storage"
}

public static let storage = UserDefaults(suiteName: Constant.pixelStorageIdentifier)!

private init() {
}

Expand All @@ -160,16 +167,28 @@ public class Pixel {
allowedQueryReservedCharacters: CharacterSet? = nil,
withHeaders headers: APIRequest.Headers = APIRequest.Headers(),
includedParameters: [QueryParameters] = [.atb, .appVersion],
onComplete: @escaping (Error?) -> Void = { _ in }) {
fire(
pixelNamed: pixel.name,
forDeviceType: deviceType,
withAdditionalParameters: params,
allowedQueryReservedCharacters: allowedQueryReservedCharacters,
withHeaders: headers,
includedParameters: includedParameters,
onComplete: onComplete
)
onComplete: @escaping (Error?) -> Void = { _ in },
debounce: Int = 0) {

let date = Date().addingTimeInterval(-TimeInterval(debounce))
if !pixel.hasBeenFiredSince(pixelStorage: storage, date: date) {
fire(
pixelNamed: pixel.name,
forDeviceType: deviceType,
withAdditionalParameters: params,
allowedQueryReservedCharacters: allowedQueryReservedCharacters,
withHeaders: headers,
includedParameters: includedParameters,
onComplete: onComplete
)
updatePixelLastFireDate(pixel: pixel)
} else {
onComplete(nil)
}
}

private static func updatePixelLastFireDate(pixel: Pixel.Event) {
storage.set(Date(), forKey: pixel.name)
}

public static func fire(pixelNamed pixelName: String,
Expand Down Expand Up @@ -240,6 +259,18 @@ extension Pixel {
}
}

private extension Pixel.Event {

func hasBeenFiredSince(pixelStorage: UserDefaults, date: Date) -> Bool {
if let lastFireDate = pixelStorage.object(forKey: name) as? Date {
return lastFireDate >= date
}
return false
}


}

/// NSError supports this through `NSUnderlyingError`, but there's no support for this for Swift's `Error`. This protocol does that.
///
/// The reason why this protocol returns a code and a domain instead of just an `Error` or `NSError` is so that the error implementing
Expand Down
2 changes: 1 addition & 1 deletion Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ extension Pixel.Event {
case .networkProtectionTunnelFailureRecovered: return "m_netp_ev_tunnel_failure_recovered"
case .networkProtectionLatency(let quality): return "m_netp_ev_\(quality.rawValue)_latency"
case .networkProtectionLatencyError: return "m_netp_ev_latency_error_d"
case .networkProtectionRekeyAttempt: return "m_mac_netp_rekey_attempt"
case .networkProtectionRekeyAttempt: return "m_netp_rekey_attempt"
case .networkProtectionRekeyCompleted: return "m_netp_rekey_completed"
case .networkProtectionRekeyFailure: return "m_netp_rekey_failure"
case .networkProtectionEnabledOnSearch: return "m_netp_ev_enabled_on_search"
Expand Down
64 changes: 40 additions & 24 deletions Core/ios-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"readme": "https://github.com/duckduckgo/privacy-configuration",
"version": 1710155313369,
"version": 1710501855617,
"features": {
"adClickAttribution": {
"readme": "https://help.duckduckgo.com/duckduckgo-help-pages/privacy/web-tracking-protections/#3rd-party-tracker-loading-protection",
Expand Down Expand Up @@ -264,6 +264,18 @@
{
"domain": "meneame.net"
},
{
"domain": "espn.com"
},
{
"domain": "usaa.com"
},
{
"domain": "publico.es"
},
{
"domain": "cnbc.com"
},
{
"domain": "earth.google.com"
},
Expand Down Expand Up @@ -292,7 +304,7 @@
"state": "enabled",
"features": {
"onByDefault": {
"state": "enabled",
"state": "disabled",
"rollout": {
"steps": [
{
Expand All @@ -308,7 +320,7 @@
}
}
},
"hash": "7401ca90e7ef3907f1c0f8cdf163b994"
"hash": "9aaa080c235ddd8df4295c4d73c87a94"
},
"autofill": {
"exceptions": [
Expand Down Expand Up @@ -1028,8 +1040,11 @@
},
"clientBrandHint": {
"exceptions": [],
"settings": {
"domains": []
},
"state": "disabled",
"hash": "728493ef7a1488e4781656d3f9db84aa"
"hash": "d35dd75140cdfe166762013e59eb076d"
},
"contentBlocking": {
"state": "enabled",
Expand Down Expand Up @@ -3925,6 +3940,23 @@
}
]
},
{
"domain": "uzone.id",
"rules": [
{
"selector": "[class^='box-ads']",
"type": "hide-empty"
},
{
"selector": "[class^='section-ads']",
"type": "hide-empty"
},
{
"selector": ".parallax-container",
"type": "hide-empty"
}
]
},
{
"domain": "washingtontimes.com",
"rules": [
Expand Down Expand Up @@ -4005,7 +4037,7 @@
]
},
"state": "enabled",
"hash": "065f70c0112e8f3a149bf4bc56f35203"
"hash": "2f1178300a22f85803bc42c676ea2cab"
},
"exceptionHandler": {
"exceptions": [
Expand Down Expand Up @@ -4670,11 +4702,6 @@
"state": "disabled",
"hash": "d07b5bf740e4d648c94e1ac65c4305d9"
},
"notificationPermissions": {
"exceptions": [],
"state": "disabled",
"hash": "728493ef7a1488e4781656d3f9db84aa"
},
"privacyDashboard": {
"exceptions": [],
"features": {
Expand Down Expand Up @@ -5929,22 +5956,11 @@
"fwmrm.net": {
"rules": [
{
"rule": "2a7e9.v.fwmrm.net/ad/g/1",
"domains": [
"channel4.com"
]
},
{
"rule": "2a7e9.v.fwmrm.net/ad/l/1",
"rule": "v.fwmrm.net/ad",
"domains": [
"6play.fr",
"channel4.com"
]
},
{
"rule": "7cbf2.v.fwmrm.net/ad/g/1",
"domains": [
"6play.fr"
]
}
]
},
Expand Down Expand Up @@ -7849,7 +7865,7 @@
"domain": "sundancecatalog.com"
}
],
"hash": "cff67ed6fc2962e0016ac3c65b6e4633"
"hash": "4d2da0fe5691d4283ebfb1021270c6ea"
},
"trackingCookies1p": {
"settings": {
Expand Down
Loading

0 comments on commit c0117b6

Please sign in to comment.