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

Adjust relay selector to support custom lists #5788

Merged

Conversation

rablador
Copy link
Contributor

@rablador rablador commented Feb 7, 2024

When a custom list enabled, the relay selector should match relays by location using the custom list - if a relay matches any of the location constraints in a custom list, it should be added to the list of eligible relays to be picked by the roulette selection.


This change is Reviewable

@rablador rablador added the iOS Issues related to iOS label Feb 7, 2024
Copy link

linear bot commented Feb 7, 2024

Copy link
Collaborator

@mojganii mojganii 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 2 files reviewed, 2 unresolved discussions (waiting on @rablador)


ios/MullvadTypes/RelayConstraints.swift line 31 at r1 (raw file):

        self.customListId = customListId
    }
}

Code snippet:

public struct RelayLocationList: Codable, Equatable {
    public let id: UUID?
    public let locations: [RelayLocation]
    
    public init(customListId: UUID? = nil ,locations: [RelayLocation]) {
        self.locations = locations
        self.id = customListId
    }
}

ios/MullvadTypes/RelayConstraints.swift line 46 at r1 (raw file):

    public init(
        locations: RelayConstraint<RelayLocationPersistent> =
            .only(RelayLocationPersistent(locations: [.country("se")], customListId: nil)),

removing nit from constructor

Copy link
Contributor

@buggmagnet buggmagnet left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @rablador)

Copy link
Contributor Author

@rablador rablador 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 2 files reviewed, 2 unresolved discussions (waiting on @mojganii)


ios/MullvadTypes/RelayConstraints.swift line 31 at r1 (raw file):

        self.customListId = customListId
    }
}

I renamed it RelayLocations and added the default param.


ios/MullvadTypes/RelayConstraints.swift line 46 at r1 (raw file):

Previously, mojganii wrote…

removing nit from constructor

Done.

@rablador rablador force-pushed the adjust-relay-selector-to-support-custom-lists-ios-461 branch from 5aac813 to 7aa591b Compare February 12, 2024 09:07
Copy link
Contributor

@buggmagnet buggmagnet 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 2 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mojganii)

@rablador rablador force-pushed the adjust-relay-selector-to-support-custom-lists-ios-461 branch 3 times, most recently from 9f40be3 to c2ebb91 Compare February 12, 2024 15:11
@rablador rablador marked this pull request as ready for review February 12, 2024 15:12
Copy link
Contributor

@buggmagnet buggmagnet left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 6 files at r3, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @mojganii and @rablador)


ios/MullvadVPN.xcodeproj/project.pbxproj line 3305 at r3 (raw file):

			sourceTree = "<group>";
		};
		7A038FDD2B7A56CF00950251 /* Recovered References */ = {

This looks like it shouldn't be here, can you make sure to delete this folder ?


ios/MullvadVPNTests/StartTunnelOperationTests.swift line 92 at r3 (raw file):

            dispatchQueue: testQueue,
            interactor: interactor
        ) { result in

Those are already fixed on main

@rablador rablador force-pushed the adjust-relay-selector-to-support-custom-lists-ios-461 branch from c2ebb91 to 7a557a8 Compare February 13, 2024 08:02
Copy link
Contributor Author

@rablador rablador 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: 7 of 9 files reviewed, 4 unresolved discussions (waiting on @buggmagnet and @mojganii)


ios/MullvadVPN.xcodeproj/project.pbxproj line 3305 at r3 (raw file):

Previously, buggmagnet wrote…

This looks like it shouldn't be here, can you make sure to delete this folder ?

Done.


ios/MullvadVPNTests/StartTunnelOperationTests.swift line 92 at r3 (raw file):

Previously, buggmagnet wrote…

Those are already fixed on main

Done.

Copy link
Contributor

@acb-mv acb-mv 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 2 files at r4, all commit messages.
Reviewable status: 8 of 9 files reviewed, 4 unresolved discussions (waiting on @buggmagnet and @mojganii)

Copy link
Contributor

@buggmagnet buggmagnet 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 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mojganii)

@rablador rablador force-pushed the adjust-relay-selector-to-support-custom-lists-ios-461 branch 2 times, most recently from f293e40 to 6ac920d Compare February 20, 2024 10:26
Copy link
Contributor

@acb-mv acb-mv left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mojganii)

Copy link
Contributor

@buggmagnet buggmagnet left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mojganii)

@buggmagnet buggmagnet force-pushed the adjust-relay-selector-to-support-custom-lists-ios-461 branch from 6ac920d to c39298e Compare February 26, 2024 08:23
@buggmagnet buggmagnet merged commit 4c0797d into main Feb 26, 2024
4 of 5 checks passed
@buggmagnet buggmagnet deleted the adjust-relay-selector-to-support-custom-lists-ios-461 branch February 26, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iOS Issues related to iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants