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

[MM-54703] Fix IPv6 issue on android #8571

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rossjackson
Copy link

@rossjackson rossjackson commented Feb 7, 2025

Summary

Not all servers may have IPv4 and IPv6 enabled and when that happens Android switching from WiFi to mobile data can interchangeably switch IP addresses. Most users on Android, including me, has experienced slow connection especially when the server is running on docker. I also experienced this issue using my other react-native app and have applied this same changes and fixed the issue. This fix is from a SO post. This will resolve this issue.

Ticket Link

MM-54703

Checklist

  • Added or updated unit tests (required for all new features)
  • Has UI changes
  • Includes text changes and localization file updates
  • Have tested against the 5 core themes to ensure consistency between them.
  • Have run E2E tests by adding label E2E iOS tests for PR.

Device Information

Android API 35

Release Note

Fixed "The server is unreachable" or "Cannot connect to the server" on android app when connected to mobile data or on VPN.

@mattermost-build
Copy link
Contributor

Hello @rossjackson,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

Per the Mattermost Contribution Guide, we need to add you to the list of approved contributors for the Mattermost project.

Please help complete the Mattermost contribution license agreement?
Once you have signed the CLA, please comment with /check-cla and confirm that the CLA check is green.

This is a standard procedure for many open source projects.

Please let us know if you have any questions.

We are very happy to have you join our growing community! If you're not yet a member, please consider joining our Contributors community channel to meet other contributors and discuss new opportunities with the core team.

@rossjackson
Copy link
Author

/check-cla

@enahum
Copy link
Contributor

enahum commented Feb 7, 2025

@rossjackson Thank you for the PR but a couple of things

  1. Okhttp 5 is still in alpha thus we really don't want to include it in our product until is production ready
  2. The update of the okhttp dependency should be done in the network library directly and not as a direct dependency of the app

@rahimrahman thoughts?

@rossjackson
Copy link
Author

Hi @enahum ,

I completely understand. The current version of okhttp doesn't have the DNS resolution which I think is causing this IPv4 and IPv6 issues, the v5 does. I added it as an override as a temporary fix until okhttp releases its v5. I was hoping this will be fine for the interim so some of your android users using data or on VPN can still use the app.

@rahimrahman
Copy link
Contributor

Hi @enahum ,

I completely understand. The current version of okhttp doesn't have the DNS resolution which I think is causing this IPv4 and IPv6 issues, the v5 does. I added it as an override as a temporary fix until okhttp releases its v5. I was hoping this will be fine for the interim so some of your android users using data or on VPN can still use the app.

I'm in agreement with @enahum

  1. okhttp v5 is still in alpha and a little bit risky to implement in production
  2. the update should be done in the react-native-network-library.

However, perhaps it's not a bad idea to implement this as an experimental version of the Mattermost app where we can deploy it to ourselves with an environment that has both IPv4 and IPv6, and lperhaps even at the same time, release to some of our users who are experiencing issues, and gather some data.

I haven't had the chance to do any type of research, but do you know if there's any talk on when they are thinking about moving okhttp v5 out of alpha phase?

@mattermost-build
Copy link
Contributor

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android app can't connect if server isn't listening on IPv6
5 participants