-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working great but I added one review comment.
Also, more importantly, this should be merged to the internals.
@@ -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 |
There was a problem hiding this comment.
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?
7c382c0
to
40bd2d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great!
# By Dax the Duck (1) and Graeme Arthur (1) # Via Dax the Duck * release/1.83.0: Bump version to 1.83.0 (158) Fix VPN bug: Nearest city breaks register requests (#2589) # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved # LocalPackages/DataBrokerProtection/Package.swift # LocalPackages/NetworkProtectionMac/Package.swift # LocalPackages/SubscriptionUI/Package.swift
# By Dax the Duck (10) and others # Via GitHub (6) and others * main: (40 commits) Bump version to 1.83.0 (160) macOS VPN: Ask users to reboot if system extension was not uninstalled (#2603) macOS VPN: Ask users to reboot if system extension was not uninstalled (#2603) Fix popover not displayed reliably when VPN shortcut is unpinned (#2606) Automatically mark / close stale PRs (#2596) Update copy for DBP open button (#2586) Bump version to 1.83.0 (159) [Release PR] Fix lottie high Windowserver load (#2598) Bump version to 1.83.0 (158) BSK release 133.1.0 (#2597) Fix VPN bug: Nearest city breaks register requests (#2589) Fix lottie high Windowserver load (#2595) drop Downloads storyboard (#2556) Disable directory download (#2585) Add supported document types (#2581) Allow choosing downloads location in App Store builds (#2532) Fix Open Downloads not working (#2576) Update Privacy Dashboard URL on navigation commit (#2583) Percent-decode download filenames (#2584) Bump version to 1.83.0 (157) ... # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Task/Issue URL: https://app.asana.com/0/1203137811378537/1207044169885477/f
Description:
Due to a bug in the VPNLocationViewModel, we were using the string “Nearest” as a city ID which ended up making it to the
register
request. This only happens when we explicitly select Nearest rather than just selecting the country (which has the same effect).Steps to test this PR:
Expected
VPN connects to the nearest city in that country
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation