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

Support for metered connections #19

Open
EndBug opened this issue Feb 23, 2022 · 3 comments
Open

Support for metered connections #19

EndBug opened this issue Feb 23, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@EndBug
Copy link

EndBug commented Feb 23, 2022

It would be nice if you could add an option that prevents auto-syncs when you're on a metered connection

@C0D3D3V
Copy link

C0D3D3V commented Feb 23, 2022

What kind of fee-based connection are you talking about? Do you mean a mobile network billed through your sim card or a public network billed through a captive portal.

@EndBug
Copy link
Author

EndBug commented Feb 23, 2022

Potentially both: on Windows (and I think on some Linux distros too) you can mark a connection as metered, if it's like a mobile hotspot or, in general, something you want to use strictly for what you need.
Apps can then see that you're on a metered network and behave accordingly: the OS is not enforcing any restriction on the app, it's just something that programs can see if they want to.

I know that for Windows this package exists: https://www.npmjs.com/package/@nodert-win10/windows.networking.connectivity (ref electron/electron#8921), I don't know if there's a way for other platforms though

@toto04 toto04 added the enhancement New feature or request label Feb 24, 2022
@toto04
Copy link
Owner

toto04 commented Feb 24, 2022

First of all thanks for the suggestion! Greatly appreciated!

I had actually already looked at that exact issue and at that package, but honestly tho, metered connections are pretty much a windows thing and as you said something like that as been implemented in some linux distros, but it's all pretty much specific to the system. macOS doesn't even appear to have any sort of API to detect whether a connection is an actual WiFi network or an hotspot, so I guess nothing can be done here, but I would be glad to be proven wrong.

Also I'm not really sure about how well maintained that package actually is, from what I saw it doesn't seem to support Windows 11, but even if it does honestly I was trying my best to not introduce any native dependencies to the app except electron in the effort to keep the build process as straight forward as possible (even tho honestly that shouldn't be that big of a hassle, I'm just being a bit picky here 😅).

If I don't find anything simpler I guess I could implement this with native dependencies, but it's really not a priority right now as there's still a couple of things I'd like to polish first. I'll definitely keep that in mind tho and if anyone finds anything else about this I'll gladly take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants