Skip to content

Commit

Permalink
Update the last VPN version run store (#2609)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/414235014887631/1206860499985742/f
Tech Design URL:
CC:

Description:

This PR updates the breakage metadata to always include the extension version.
  • Loading branch information
samsymons authored Mar 21, 2024
1 parent 5d0afae commit 324cacc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10033,7 +10033,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 127.1.1;
version = 128.0.0;
};
};
B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */ = {
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" : "1ba3e3682b9231a1d8685f1d16f950e7910b8593",
"version" : "127.1.1"
"branch" : "128.0.0",
"revision" : "6c5ed334b3ea7b4394bec697067654182f75c877"
}
},
{
Expand Down
10 changes: 7 additions & 3 deletions DuckDuckGo/Feedback/VPNMetadataCollector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct VPNMetadata: Encodable {

struct AppInfo: Encodable {
let appVersion: String
let lastVersionRun: String
let lastExtensionVersionRun: String
let isInternalUser: Bool
}

Expand Down Expand Up @@ -132,10 +132,14 @@ final class DefaultVPNMetadataCollector: VPNMetadataCollector {

private func collectAppInfoMetadata() -> VPNMetadata.AppInfo {
let appVersion = AppVersion.shared.versionNumber
let versionStore = NetworkProtectionLastVersionRunStore()
let versionStore = NetworkProtectionLastVersionRunStore(userDefaults: .networkProtectionGroupDefaults)
let isInternalUser = AppDependencyProvider.shared.internalUserDecider.isInternalUser

return .init(appVersion: appVersion, lastVersionRun: versionStore.lastVersionRun ?? "Unknown", isInternalUser: isInternalUser)
return .init(
appVersion: appVersion,
lastExtensionVersionRun: versionStore.lastExtensionVersionRun ?? "Unknown",
isInternalUser: isInternalUser
)
}

private func collectDeviceInfoMetadata() -> VPNMetadata.DeviceInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ final class NetworkProtectionPacketTunnelProvider: PacketTunnelProvider {
case .connecting:
DailyPixel.fireDailyAndCount(pixel: .networkProtectionEnableAttemptConnecting)
case .success:
let versionStore = NetworkProtectionLastVersionRunStore(userDefaults: .networkProtectionGroupDefaults)
versionStore.lastExtensionVersionRun = AppVersion.shared.versionAndBuildNumber

DailyPixel.fireDailyAndCount(pixel: .networkProtectionEnableAttemptSuccess)
case .failure:
DailyPixel.fireDailyAndCount(pixel: .networkProtectionEnableAttemptFailure)
Expand Down

0 comments on commit 324cacc

Please sign in to comment.