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

Refactor DisconnectingState::handle_commands #7664

Merged
merged 1 commit into from
Feb 14, 2025
Merged

Conversation

Serock3
Copy link
Contributor

@Serock3 Serock3 commented Feb 13, 2025

Refactor DisconnectingState::handle_commands to reduce code duplication.


This change is Reviewable

@Serock3 Serock3 requested a review from dlon February 13, 2025 13:32
@Serock3 Serock3 self-assigned this Feb 13, 2025
Copy link
Member

@dlon dlon left a comment

Choose a reason for hiding this comment

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

Very nice cleanup!

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion


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

            Some(TunnelCommand::Connectivity(connectivity)) => {
                shared_values.connectivity = connectivity;
                if !connectivity.is_offline() {

I think the logic was modified a bit here: If connectivity.is_offline() && matches!(_, AfterDisconnect::Reconnect(_)), should it not switch to AfterDisconnect::Block(_)?

Copy link
Member

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

@Serock3 Serock3 force-pushed the refactor-handle-commands branch from 79b8770 to 70c4505 Compare February 13, 2025 16:01
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: 0 of 1 files reviewed, all discussions resolved (waiting on @dlon)


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

Previously, dlon (David Lönnhager) wrote…

I think the logic was modified a bit here: If connectivity.is_offline() && matches!(_, AfterDisconnect::Reconnect(_)), should it not switch to AfterDisconnect::Block(_)?

Good catch!

@Serock3 Serock3 force-pushed the refactor-handle-commands branch from 70c4505 to 2439367 Compare February 13, 2025 16:04
@Serock3 Serock3 force-pushed the refactor-handle-commands branch from 2439367 to a8523e2 Compare February 14, 2025 08:57
Copy link
Member

@dlon dlon left a 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: :shipit: complete! all files reviewed, all discussions resolved

@Serock3 Serock3 merged commit c64f406 into main Feb 14, 2025
51 of 52 checks passed
@Serock3 Serock3 deleted the refactor-handle-commands branch February 14, 2025 09:23
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