finamp icon indicating copy to clipboard operation
finamp copied to clipboard

Do not turn off offline mode in some Wi-Fi Networks

Open GooDoG337 opened this issue 8 months ago • 2 comments

Type:

  • [ ] New feature
  • [X] Improve or extend an existing feature
  • [ ] Other:

Explanation

Give ability to set Wi-Fis, in which offline mode will be turned off. In other Wi-Fis offline mode will be turned on Or allow to turn on offline mode in limited Wi-Fi networks.

Reasoning

Every day my phone gets connected to some Wi-Fi networks, but I can connect to my server only from my home network. I have set other Wi-Fi as limited, but offline mode still turns off, so I get connection errors.

Implementation Notes

Maybe something like list of allowed networks? And then check, if WiFi SSID = SSID from list, so turn the offline mode off.

GooDoG337 avatar Apr 23 '25 08:04 GooDoG337

So for #1162 we found a solution that avoids reading the WiFi network - since that requires the "exact location" permission, which is not something that we want to request.
That means we won't be able to toggle offline mode based on the current WiFi name.
But maybe we could add the ability to enable offline mode if the server can't be reached via the local URL (i.e. if there is no remote URL). @flloschy do you think that would be possible to add?

Chaphasilor avatar May 20 '25 14:05 Chaphasilor

I can imagine that this could result in a few unwanted triggers? Maybe a toggle "local only" or auto detect if the primary address is local might be better solutions?

flloschy avatar May 20 '25 17:05 flloschy

OK I have an idea what we can do here if "prefer local address" is off and the public/primary address is a local address (no https and starting with 198...) we do the following

Network update received -> local address reachable -> offline mode off else on

But when this "variant" of autoOffline mode is in use the current implementation needs to be skipped/disabled/paused

Alternativly another toggle button? But do we really need more buttons and settings? Haha

flloschy avatar Jun 15 '25 15:06 flloschy

But I'll wait for the refactoring so I can maybe split autoOffline logic into more files, the single file is soooo unreadable even for me

flloschy avatar Jun 15 '25 15:06 flloschy

This has now been resolved as part of beta version 0.9.18!

Chaphasilor avatar Jun 15 '25 20:06 Chaphasilor

@Chaphasilor is it?

flloschy avatar Jun 15 '25 20:06 flloschy

Maybe I misread the issue. This is about auto-offline based on server connectivity?

If so we could integrate this with the local/remote address settings, where you can choose if the initial address that was configured during login is a local or remote URL, and if it's a local one, if there is a remote address or if offline mode should be used instead.
Then we can handle the logic all in one place?

Chaphasilor avatar Jun 15 '25 21:06 Chaphasilor

that be my idea: https://github.com/jmshrv/finamp/issues/1180#issuecomment-2974089170

flloschy avatar Jun 15 '25 22:06 flloschy

@GooDoG337 ive added a new Auto Offline Option called "Unreachable". When a network change is detected it tries to ping the server and based on that OfflineMode is enabled/disabled

Would you consider this to be sufficient to achieve what you suggested?

flloschy avatar Jun 21 '25 10:06 flloschy

@GooDoG337 ive added a new Auto Offline Option called "Unreachable". When a network change is detected it tries to ping the server and based on that OfflineMode is enabled/disabled

Would you consider this to be sufficient to achieve what you suggested?

Sorry for late response. Yes, thanks for implementing this feature

GooDoG337 avatar Jul 03 '25 19:07 GooDoG337

@Chaphasilor one step closer to sub 200 issues!

flloschy avatar Jul 03 '25 20:07 flloschy