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

Fix VPN bug: Nearest city breaks register requests #2589

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14447,8 +14447,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 133.0.0;
branch = "graeme/fix-nearest-city-bug";
kind = branch;
};
};
9FF521422BAA8FF300B9819B /* 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" : "c0b0cb55e7ac2f69d10452e1a5c06713155d798e",
"version" : "133.0.0"
"branch" : "graeme/fix-nearest-city-bug",
"revision" : "68c9d7a625827d48381fd61914f86685911d0304"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ final class VPNLocationViewModel: ObservableObject {

func onCountryItemSelection(id: String, cityId: String? = nil) async {
DailyPixel.fire(pixel: .networkProtectionGeoswitchingSetCustom, frequency: .dailyAndCount)
let location = NetworkProtectionSelectedLocation(country: id, city: cityId)
let city = cityId == VPNCityItemModel.nearest.id ? nil : cityId
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fix for issue. Though, longterm, it would be better to rethink the id’s type. It’s not ideal right now using the string value like we are.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree - can you scope up a follow up task to do this?

let location = NetworkProtectionSelectedLocation(country: id, city: city)
selectedLocation = .location(location)
await reloadList()
}
Expand Down