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

Changed network connection check logic #1359

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

ISO-B
Copy link
Contributor

@ISO-B ISO-B commented Oct 31, 2024

Network connection no longer requires internet connection. Socket connection status is used instead for checking if server is reachable. If there is no socket connection available eq. before connecting to server then connection type is used to for network connection check.

This should fix #566

Test cases, tested with Android 11 and 14:

  1. Wifi connection with access to internet. Everything worked as previously
  2. Wifi connection without access to internet. I was able to change server, browse library and stream content
  3. Cellular connection with VPN to allow access to server. Everything worked as previously
  4. Cellular connection without VPN, no access to server. Offline mode, but I was able to try connection to different server/adding new server
  5. No wifi or cellular connection. Offline mode, adding new server shows no network connection.

Network connection no longer requires internet connection. Socket connection status is used instead for checking if server is reachable. If there is no socket connection available eq. before connecting to server then connection type is used to for netrork connection check.
@advplyr
Copy link
Owner

advplyr commented Nov 2, 2024

Thanks!

@advplyr advplyr merged commit 102fd1f into advplyr:master Nov 2, 2024
1 check passed
@@ -165,7 +165,11 @@ export const mutations = {
state.isNetworkListenerInit = val
},
setNetworkStatus(state, val) {
state.networkConnected = val.connected
Copy link
Owner

Choose a reason for hiding this comment

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

I'm confused about this change actually. Was val.connected false in your testing when connectionType was not none?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I completely ignored val.connected value based on assumption that if connectionType is none there can't be usable connection. I assume that wifi, cellular and unkown values for connectionType indicate that device is connected to some kind of network. That network might or might not have connection to internet which is indicated by val.connected. This should let app to work without internet connection, like with lan server. Like wise it should let app to work as offline if your server is on internet and you don't have internet connection.

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.

Unable to play off local server without internet connection
2 participants