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

Update BSK with AI Chat deeplink feature flag #3786

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions Core/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public enum FeatureFlag: String {
case textZoom
case adAttributionReporting
case aiChat
case aiChatDeepLink

/// https://app.asana.com/0/72649045549333/1208231259093710/f
case networkProtectionUserTips
Expand Down Expand Up @@ -140,6 +141,8 @@ extension FeatureFlag: FeatureFlagDescribing {
return .remoteDevelopment(.subfeature(PrivacyProSubfeature.privacyProFreeTrialJan25))
case .aiChat:
return .remoteReleasable(.feature(.aiChat))
case .aiChatDeepLink:
return .remoteReleasable(.subfeature(AIChatSubfeature.deepLink))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11901,7 +11901,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 224.5.0;
version = 224.6.0;
};
};
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "1700c54067b6676974676ca9a81d654317a093f1",
"version" : "224.5.0"
"revision" : "20316b105d8874e10cf544a9c97e97237441ae01",
"version" : "224.6.0"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo/TabURLInterceptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class TabURLInterceptorDefault: TabURLInterceptor {
]

func allowsNavigatingTo(url: URL) -> Bool {
if url.isDuckAIURL {
if featureFlagger.isFeatureOn(.aiChatDeepLink), url.isDuckAIURL {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added extra check to prevent this flow in case the FF is off.

return handleURLInterception(interceptedURL: .aiChat, queryItems: nil)
}

Expand Down Expand Up @@ -102,7 +102,7 @@ extension TabURLInterceptorDefault {
return false
}
case .aiChat:
if featureFlagger.isFeatureOn(.aiChat) {
if featureFlagger.isFeatureOn(.aiChatDeepLink) {
NotificationCenter.default.post(
name: .urlInterceptAIChat,
object: nil,
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGoTests/TabURLInterceptorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class TabURLInterceptorDefaultTests: XCTestCase {
}

func testNotificationForInterceptedAIChatPathWhenFeatureFlagIsOn() {
urlInterceptor = TabURLInterceptorDefault(featureFlagger: MockFeatureFlagger(enabledFeatureFlags: [.aiChat]), canPurchase: { true })
urlInterceptor = TabURLInterceptorDefault(featureFlagger: MockFeatureFlagger(enabledFeatureFlags: [.aiChatDeepLink]), canPurchase: { true })

_ = self.expectation(forNotification: .urlInterceptAIChat, object: nil, handler: nil)

Expand Down
Loading