-
Notifications
You must be signed in to change notification settings - Fork 357
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
Implement feature indicators in daemon #6481
Implement feature indicators in daemon #6481
Conversation
a9b3239
to
b60260d
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.
Reviewed 13 of 13 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @hulthe)
android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt
line 226 at r1 (raw file):
ManagementInterface.DaemonEvent.EventCase.REMOVE_DEVICE -> {} ManagementInterface.DaemonEvent.EventCase.EVENT_NOT_SET -> {} ManagementInterface.DaemonEvent.EventCase.FEATURE_INDICATORS -> {}
mullvad-types/src/features.rs
Outdated
pub struct FeatureIndicators { | ||
pub active_features: HashSet<FeatureIndicator>, | ||
} | ||
|
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.
Maybe this should just be a tuple struct so we avoid having to name the only field? I.e. FeatureIndicators(HashSet<FeatureIndicator>)
.
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.
Might as well tbh
485d2f3
to
027f72a
Compare
f2a40b0
to
b9ab1f8
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.
There seems to be no code for triggering a new TunnelState
when a setting changes that affects feature indicators, but not the tunnelstate itself, e.g. lockdown mode. You likely still have to listen to changes to the settings to capture this.
Reviewed 8 of 11 files at r3, 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @hulthe)
mullvad-cli/src/format.rs
line 25 at r4 (raw file):
endpoint, location, feature_indicators: _,
What do you think about printing the feature indicators as a part of the CLI?
mullvad-management-interface/src/client.rs
line 54 at r1 (raw file):
Previously, MarkusPettersson98 (Markus Pettersson) wrote…
Dropped
FeatureIndicators
from theDaemonEvent
enum, think it turned out better!
Great work! 😄
79442fa
to
afd0588
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.
Reviewed 1 of 2 files at r5, 4 of 4 files at r6, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @hulthe)
mullvad-daemon/src/lib.rs
line 1116 at r6 (raw file):
/// Update the set of feature indicators. fn handle_feature_indicator_event(&self) {
Perhaps this function could take the new settings, convert them to feature indicators and only notify about a new tunnel state if they are different from new_indicators
?
afd0588
to
ccf77ad
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.
Done
Reviewable status: 13 of 15 files reviewed, 2 unresolved discussions (waiting on @hulthe and @Serock3)
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 2 of 2 files at r7, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @hulthe)
mullvad-daemon/src/lib.rs
line 1123 at r7 (raw file):
let new_feature_indicators = self.get_feature_indicators(); if *current_feature_indicators != new_feature_indicators { // Make sure to update the daemon's actual tunnel state. Otherwise feature indicator changes won't be persisted.
Good catch!
ccf77ad
to
b9a635c
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.
Reviewed 4 of 4 files at r8, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @hulthe)
dcb7067
to
b8ac868
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.
Reviewed 1 of 1 files at r9, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @hulthe)
- Add a GetFeatureIndicators gRPC call that get's the current set of active "features" that should be shown in the UI. - Extend the TunnelState with a FeatureIndicators value. Clients who listens for TunnelState events will get updates automatically.
b01d3d0
to
7992055
Compare
This change is