-
Notifications
You must be signed in to change notification settings - Fork 369
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
Add data-driven TunnelSettingsUpdate type and method for atomically applying them... #5809
Add data-driven TunnelSettingsUpdate type and method for atomically applying them... #5809
Conversation
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.
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @acb-mv)
ios/MullvadVPN/View controllers/Preferences/PreferencesInteractor.swift
line 43 at r1 (raw file):
} func setDNSSettings(_ newDNSSettings: DNSSettings, completion: (() -> Void)? = nil) {
Why do we keep this one around?
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.
Asides from the changes @rablador mentioned, this looks good.
2 things that don't appear in this PR but could be fixed here
⚠️ Line Length Violation: Line should be 120 characters or less; currently it has 154 characters (line_length) inPreferencesViewController:166
⚠️ Function Body Length Violation: Function body should span 50 lines or less excluding comments and whitespace: currently spans 54 lines (function_body_length) inPreferencesViewController:115
For the later one, we can just issue a // swiftlint:disable:next function_body_length
directive
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @rablador)
ios/MullvadVPN/View controllers/Preferences/PreferencesInteractor.swift
line 43 at r1 (raw file):
Previously, rablador (Jon Petersson) wrote…
Why do we keep this one around?
Agreed, it looks like we can get rid of it
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.
Reviewable status: 4 of 6 files reviewed, 1 unresolved discussion (waiting on @buggmagnet and @rablador)
ios/MullvadVPN/View controllers/Preferences/PreferencesInteractor.swift
line 43 at r1 (raw file):
Previously, buggmagnet wrote…
Agreed, it looks like we can get rid of it
It is my plan to replace other set
methods with updateSettings
before the PR gets promoted from draft.
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.
Reviewed 8 of 8 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @acb-mv and @rablador)
ios/MullvadVPNTests/MullvadSettings/TunnelSettingsUpdateTests.swift
line 15 at r2 (raw file):
final class TunnelSettingsUpdateTests: XCTestCase { override func setUpWithError() throws {
nit
If we don't intend to use those, we can remove them
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.
Reviewable status: 8 of 9 files reviewed, 1 unresolved discussion (waiting on @buggmagnet and @rablador)
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.
Reviewed 7 of 8 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
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.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
…pplying them, modify Preferences{Interactor,ViewController} to use these.
92062fc
to
e329328
Compare
modify Preferences{Interactor,ViewController} to use these.
This means that for each preferences change, the tunnel gets recreated only once. It also gives us a data-driven type for modelling changes to the preferences, factoring code out of TunnelManager into a self-contained type.
This change is