Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes VPN waitlist and beta code #801

Merged
merged 16 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removes waitlist info
  • Loading branch information
diegoreymendez committed Apr 26, 2024
commit 3965d2cdf3725fc3718c9e8e1ebc17c778faead3
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ private enum AttributesKey: String, CaseIterable {
case favorites
case appTheme
case daysSinceInstalled
case isNetPWaitlistUser
case daysSinceNetPEnabled

func matchingAttribute(jsonMatchingAttribute: AnyDecodable) -> MatchingAttribute {
Expand All @@ -56,7 +55,6 @@ private enum AttributesKey: String, CaseIterable {
case .favorites: return FavoritesMatchingAttribute(jsonMatchingAttribute: jsonMatchingAttribute)
case .appTheme: return AppThemeMatchingAttribute(jsonMatchingAttribute: jsonMatchingAttribute)
case .daysSinceInstalled: return DaysSinceInstalledMatchingAttribute(jsonMatchingAttribute: jsonMatchingAttribute)
case .isNetPWaitlistUser: return IsNetPWaitlistUserMatchingAttribute(jsonMatchingAttribute: jsonMatchingAttribute)
case .daysSinceNetPEnabled: return DaysSinceNetPEnabledMatchingAttribute(jsonMatchingAttribute: jsonMatchingAttribute)
}
}
Expand Down
25 changes: 0 additions & 25 deletions Sources/RemoteMessaging/Model/MatchingAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -608,31 +608,6 @@ struct RangeStringNumericMatchingAttribute: Equatable {
}
}

struct IsNetPWaitlistUserMatchingAttribute: MatchingAttribute, Equatable {
var value: Bool?
var fallback: Bool?

init(jsonMatchingAttribute: AnyDecodable) {
guard let jsonMatchingAttribute = jsonMatchingAttribute.value as? [String: Any] else { return }

if let value = jsonMatchingAttribute[RuleAttributes.value] as? Bool {
self.value = value
}
if let fallback = jsonMatchingAttribute[RuleAttributes.fallback] as? Bool {
self.fallback = fallback
}
}

init(value: Bool?, fallback: Bool?) {
self.value = value
self.fallback = fallback
}

static func == (lhs: IsNetPWaitlistUserMatchingAttribute, rhs: IsNetPWaitlistUserMatchingAttribute) -> Bool {
return lhs.value == rhs.value && lhs.fallback == rhs.fallback
}
}

struct DaysSinceNetPEnabledMatchingAttribute: MatchingAttribute, Equatable {
var min: Int = MatchingAttributeDefaults.intDefaultValue
var max: Int = MatchingAttributeDefaults.intDefaultMaxValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ class JsonToRemoteConfigModelMapperTests: XCTestCase {
attribs = rule8?.value.filter { $0 is DaysSinceNetPEnabledMatchingAttribute }
XCTAssertEqual(attribs?.count, 1)
XCTAssertEqual(attribs?.first as? DaysSinceNetPEnabledMatchingAttribute, DaysSinceNetPEnabledMatchingAttribute(min: 5, fallback: nil))

attribs = rule8?.value.filter { $0 is IsNetPWaitlistUserMatchingAttribute }
XCTAssertEqual(attribs?.count, 1)
XCTAssertEqual(attribs?.first as? IsNetPWaitlistUserMatchingAttribute, IsNetPWaitlistUserMatchingAttribute(value: true, fallback: nil))
}

func testWhenJsonMessagesHaveUnknownTypesThenMessagesNotMappedIntoConfig() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
favoritesCount: 88,
appTheme: "default",
isWidgetInstalled: true,
isNetPWaitlistUser: true,

Check failure on line 56 in Tests/BrowserServicesKitTests/RemoteMessaging/Matchers/UserAttributeMatcherTests.swift

View workflow job for this annotation

GitHub Actions / Run unit tests (iOS)

extra argument 'isNetPWaitlistUser' in call
daysSinceNetPEnabled: 3)
}

Expand Down Expand Up @@ -207,16 +207,6 @@

// MARK: - Network Protection Waitlist

func testWhenIsNetPWaitlistUserMatchesThenReturnMatch() throws {
XCTAssertEqual(userAttributeMatcher.evaluate(matchingAttribute: IsNetPWaitlistUserMatchingAttribute(value: true, fallback: nil)),
.match)
}

func testWhenIsNetPWaitlistUserDoesNotMatchThenReturnFail() throws {
XCTAssertEqual(userAttributeMatcher.evaluate(matchingAttribute: IsNetPWaitlistUserMatchingAttribute(value: false, fallback: nil)),
.fail)
}

func testWhenDaysSinceNetPEnabledMatchesThenReturnMatch() throws {
XCTAssertEqual(userAttributeMatcher.evaluate(matchingAttribute: DaysSinceNetPEnabledMatchingAttribute(min: 1, fallback: nil)),
.match)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class RemoteMessagingConfigMatcherTests: XCTestCase {
favoritesCount: 0,
appTheme: "light",
isWidgetInstalled: false,
isNetPWaitlistUser: false,
daysSinceNetPEnabled: -1),
dismissedMessageIds: []
)
Expand Down Expand Up @@ -113,7 +112,6 @@ class RemoteMessagingConfigMatcherTests: XCTestCase {
favoritesCount: 0,
appTheme: "light",
isWidgetInstalled: false,
isNetPWaitlistUser: false,
daysSinceNetPEnabled: -1),
dismissedMessageIds: [])

Expand Down Expand Up @@ -182,7 +180,6 @@ class RemoteMessagingConfigMatcherTests: XCTestCase {
favoritesCount: 0,
appTheme: "light",
isWidgetInstalled: false,
isNetPWaitlistUser: false,
daysSinceNetPEnabled: -1),
dismissedMessageIds: ["1"])

Expand Down Expand Up @@ -212,7 +209,6 @@ class RemoteMessagingConfigMatcherTests: XCTestCase {
favoritesCount: 0,
appTheme: "light",
isWidgetInstalled: false,
isNetPWaitlistUser: false,
daysSinceNetPEnabled: -1),
dismissedMessageIds: [])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class RemoteMessagingConfigProcessorTests: XCTestCase {
favoritesCount: 0,
appTheme: "light",
isWidgetInstalled: false,
isNetPWaitlistUser: false,
daysSinceNetPEnabled: -1),
dismissedMessageIds: []
)
Expand Down Expand Up @@ -64,7 +63,6 @@ class RemoteMessagingConfigProcessorTests: XCTestCase {
favoritesCount: 0,
appTheme: "light",
isWidgetInstalled: false,
isNetPWaitlistUser: false,
daysSinceNetPEnabled: -1),
dismissedMessageIds: [])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,6 @@
{
"id": 8,
"attributes": {
"isNetPWaitlistUser": {
"value": true
},
samsymons marked this conversation as resolved.
Show resolved Hide resolved
"daysSinceNetPEnabled": {
"min": 5
}
Expand Down
Loading