mattermost / mattermost-mobile

Next generation iOS and Android apps for Mattermost in React Native
https://about.mattermost.com/
Apache License 2.0
2.25k stars 1.36k forks source link

Mattermost on Android via Per-App VPN #7636

Closed tlinnyc closed 11 months ago

tlinnyc commented 1 year ago

Summary

I'm using MS Defender through my work profile, Mattermost requires VPN to be connected for it to successfully connect to our server, if the VPN isn't on, MM will just say server unreachable. Even if I go ahead and turn on VPN and switch back to MM, it'll stay on unreachable until I kill the app and relaunch it. Of course this is a different story for iOS because it supports the VPN waiting function. MM doc also said that Android OS can't support the waiting function, but is there a way to workaround that?

Environment Information

Steps to reproduce

  1. Launch MM without MS Defender VPN on (I think this might be the case with any VPN, but haven't tested)
  2. MM will say Server unreachable, minimize it and switch over to MS Defender VPN and turn it on
  3. Switch back to MM, it will still say unreachable

I turned on Always-on VPN for MS Defender, but issue still happens if network drops and recovers

  1. With VPN on and MM connected, make network drop for a sec either by changing to wifi or mobile data
  2. Network recovers and then MS Defender auto reconnects back to VPN
  3. MM will stay on unreachable until app is restarted

Expected behavior

MM will try to attempt reconnecting every X seconds up to X amount of times while in unreachable state

Observed behavior (that appears unintentional)

MM saying "The server is not reachable"

Possible fixes

Would it be possible to have it auto retry connection without the need of restarting the app?

amyblais commented 1 year ago

Opened https://mattermost.atlassian.net/browse/MM-55188.

amyblais commented 11 months ago

@tlinnyc We were unable to reproduce this internally. Here are the dev's notes:

"Unable to reproduce, switching between non-VPN and VPN connections, including dropping and reconnection, switching between wifi and cellular networks do establish the WebSocket connection and regular http connections without issue.

Is important to note that Android does not have the capability to start the VPN automatically the same way iOS does, so the VPN connection should be established manually.

VPN's used: Express VPN OpenVPN NordVPN CyberGhostVPN Tailscale (used by Mattermost)"