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

Log if Same IP is used when starting a tunnel #5228

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

buggmagnet
Copy link
Contributor

@buggmagnet buggmagnet commented Oct 4, 2023

This change is Reviewable

@buggmagnet buggmagnet added the iOS Issues related to iOS label Oct 4, 2023
@buggmagnet buggmagnet self-assigned this Oct 4, 2023
@linear
Copy link

linear bot commented Oct 4, 2023

IOS-326 Log when Same IP is being used

Log when the device uses the known Same IP IP. See linked desktop issue for details.

@buggmagnet buggmagnet requested a review from rablador October 4, 2023 12:36
.contains { $0 == ApplicationConfiguration.sameIPv6 }

let isNotUsingSameIP = (hasIPv4SameAddress || hasIPv6SameAddress) == false ? " NOT " : " "
providerLogger.debug("Same IP is\(isNotUsingSameIP)being used")
Copy link
Member

Choose a reason for hiding this comment

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

On first sight this really looked like it would miss a space between "is" and "being" when Same IP is being used. I'm not going to nitpick about your codebase, but if I wrote it I would have IsNotUsingSameIp be empty when it is being used and otherwise "NOT " and adjust formatting string accordingly. :)

ios/Shared/ApplicationConfiguration.swift Show resolved Hide resolved
@buggmagnet buggmagnet force-pushed the log-when-same-ip-is-being-used-ios-326 branch from 8d710c0 to 6ef69e6 Compare October 5, 2023 07:25
Copy link
Contributor Author

@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.

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @faern)


ios/PacketTunnel/PacketTunnelProvider.swift line 249 at r1 (raw file):

Previously, faern (Linus Färnstrand) wrote…

On first sight this really looked like it would miss a space between "is" and "being" when Same IP is being used. I'm not going to nitpick about your codebase, but if I wrote it I would have IsNotUsingSameIp be empty when it is being used and otherwise "NOT " and adjust formatting string accordingly. :)

You're right, I've reversed the check to make it (slightly) easier to read.


ios/Shared/ApplicationConfiguration.swift line 43 at r1 (raw file):

Previously, faern (Linus Färnstrand) wrote…

Since the app in an ideal world should not need to know these IPs, I would add a comment, maybe a // TODO style comment, explaining that this is just temporary for aiding with debugging during migration to the Same IP system. And that it can be removed once the migration is done.

To help avoid it becoming arcane code living forever for no reason :)

Done.

@buggmagnet buggmagnet force-pushed the log-when-same-ip-is-being-used-ios-326 branch from 6ef69e6 to 366f7ab Compare October 5, 2023 07:36
@buggmagnet buggmagnet force-pushed the log-when-same-ip-is-being-used-ios-326 branch from 366f7ab to cae5cdf Compare October 5, 2023 07:55
@buggmagnet buggmagnet merged commit cfde812 into main Oct 5, 2023
4 checks passed
@buggmagnet buggmagnet deleted the log-when-same-ip-is-being-used-ios-326 branch October 5, 2023 07:57
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.

2 participants