-
Notifications
You must be signed in to change notification settings - Fork 342
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 smart routing to daita settings data #6870
Add smart routing to daita settings data #6870
Conversation
3a830d0
to
568584e
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.
2024-09-30 10:26:45.003185+0200 MullvadVPN[1536:467494] [LoadTunnelConfigurationOperation] Cannot read settings.
Caused by: Key "daitaState" not found at "data.daita". (domain = NSCocoaErrorDomain, code = 4865)
If I upgrade from an existing AppStore Build, I cannot connect anymore.
Please make sure to:
- Test upgrading from a public version
- Add unit tests (ideally automated one but that's up to your discretion) that test this.
Reviewed 13 of 13 files at r1, 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.
Ah, my bad, I forgot about migration!
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.
Should we either:
- Keep
state
(rather than renaming todaitaState
) and addsmartRouting
prop? - Deprecate
state
and introducedaitaState
andsmartRoutingState
(like current code)?
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.
Ex of second option:
@available(*, deprecated, renamed: "daitaState")
public let state: DAITAState = .off
[...]
public init(from decoder: any Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
daitaState = try container.decodeIfPresent(DAITAState.self, forKey: .daitaState)
?? container.decodeIfPresent(DAITAState.self, forKey: .state)
?? .off
smartRoutingState = try container.decode(SmartRoutingState.self, forKey: .smartRoutingState)
}
Reviewable status: complete! all files reviewed, all discussions resolved
9af2b2e
to
f82898e
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.
Option 1 is better IMHO, daitaState is redundant since we're already talking about a DaitaSettings
object.
Reviewable status: 12 of 13 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.
What would the name of the smart routing state? We could call it simply smartRouting
, but then we'd end up with state
and smartRouting
where both are states.
Reviewable status: 12 of 13 files reviewed, all discussions resolved (waiting on @buggmagnet)
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.
Ok I see what you mean, then let's go with your original proposition. We rename state
to daitaState
and introduce the smart routing var as well.
Reviewable status: 12 of 13 files reviewed, all discussions resolved
f82898e
to
11bd868
Compare
11bd868
to
9af680a
Compare
🚨 End to end tests failed. Please check the failed workflow run. |
This change is