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

Make mullvad status print if lockdown mode is enabled while disconnected #5656

Merged
merged 4 commits into from
Jan 18, 2024

Conversation

Serock3
Copy link
Contributor

@Serock3 Serock3 commented Jan 4, 2024

Fixes DES-535


This change is Reviewable

@Serock3 Serock3 requested a review from raksooo January 4, 2024 10:54
@Serock3 Serock3 force-pushed the cli_satus_lockdown branch 4 times, most recently from a69cdb0 to 3b638f9 Compare January 8, 2024 15:16
@Serock3 Serock3 marked this pull request as ready for review January 9, 2024 12:10
Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 left a 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 @Serock3)


talpid-core/src/tunnel_state_machine/disconnected_state.rs line 171 at r1 (raw file):

                    shared_values.block_when_disconnected = block_when_disconnected;

                    // TODO: Investigate if we can simply return

TODO

Is this meant to be left in the code for some future PR, or are you intending to investigate this in this PR?:)

Code quote:

TODO

Copy link
Contributor Author

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)


talpid-core/src/tunnel_state_machine/disconnected_state.rs line 171 at r1 (raw file):

Previously, MarkusPettersson98 (Markus Pettersson) wrote…

TODO

Is this meant to be left in the code for some future PR, or are you intending to investigate this in this PR?:)

I intended this to be left for a future PR. Initially I just usedSelf::enter and hoped for the best, but David convinced me to go for the safer alternative and leave a comment to the next person working on this part of the codebase.

@Serock3 Serock3 force-pushed the cli_satus_lockdown branch from 3b638f9 to 4cb98e9 Compare January 10, 2024 11:45
Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 left a 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 r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Serock3)


talpid-core/src/tunnel_state_machine/disconnected_state.rs line 171 at r1 (raw file):

Previously, Serock3 (Sebastian Holmin) wrote…

I intended this to be left for a future PR. Initially I just usedSelf::enter and hoped for the best, but David convinced me to go for the safer alternative and leave a comment to the next person working on this part of the codebase.

Okay, good! 😊


talpid-core/src/tunnel_state_machine/disconnected_state.rs line 170 at r2 (raw file):

            }
            Some(TunnelCommand::BlockWhenDisconnected(block_when_disconnected, complete_tx)) => {
                if dbg!(shared_values.block_when_disconnected != block_when_disconnected) {

Left-over dbg! 😄

Code quote:

dbg!

@Serock3 Serock3 force-pushed the cli_satus_lockdown branch 3 times, most recently from 0b83f7e to 279645c Compare January 15, 2024 15:52
Copy link
Contributor Author

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 13 files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)


talpid-core/src/tunnel_state_machine/disconnected_state.rs line 170 at r2 (raw file):

Previously, MarkusPettersson98 (Markus Pettersson) wrote…

Left-over dbg! 😄

Fixed

Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 left a comment

Choose a reason for hiding this comment

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

The code looks good! Now we have to fix the issues with the Android CI 😊

Reviewed 11 of 11 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@Serock3 Serock3 force-pushed the cli_satus_lockdown branch 4 times, most recently from 2da4bc0 to 30d8c8a Compare January 17, 2024 13:01
Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 5 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Add `locked_down` field to disconnected tunnel state.
The printing of lockdown mode by `mullvad status` does not reflect the
current setting unless the tunnel state has also been updated.
Here we manually implement the `IntoJava` trait of jnix to skip the
`locked_down` field of `TunnelState::Disconnected` as the derive macro
currently does not support skipping fields of struct variants in and
enum. It was decided that this solution is the preferred to updating the
macro since the jnix crate will be dropped once android implements gRPC.
@Serock3 Serock3 force-pushed the cli_satus_lockdown branch from 527adb6 to 0a43e6f Compare January 18, 2024 14:33
Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@MarkusPettersson98 MarkusPettersson98 merged commit 8f8e8c4 into main Jan 18, 2024
43 checks passed
@MarkusPettersson98 MarkusPettersson98 deleted the cli_satus_lockdown branch January 18, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants