Alpaca icon indicating copy to clipboard operation
Alpaca copied to clipboard

Papercut: Add a banner if metered connection is detected

Open lightonflux opened this issue 8 months ago • 6 comments

A nice feature for the download manager would be to warn the user if the connection is metered.

busctl get-property org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager org.freedesktop.NetworkManager Metered

This returns a u (uint32) enum value:

  • 0 (NM_METERED_UNKNOWN)
  • 1 (NM_METERED_YES)
  • 2 (NM_METERED_NO)
  • 3 (NM_METERED_GUESS_YES)
  • 4 (NM_METERED_GUESS_NO)

Docs

This could be displayed as a banner. Which maybe also helpful for the chat view if the user is using an online provider and is offline (NM_CONNECTIVITY_*).

lightonflux avatar Apr 13 '25 17:04 lightonflux

Hi, I'll have to think about this one cause it would require the Flatpak to have an additional permission

system-talk-name org.freedesktop.NetworkManager

Jeffser avatar Apr 13 '25 19:04 Jeffser

Good to know. I did not think about the implication for the sandbox. Sounds quite far reaching. Maybe this is something that should be brought up in flatpaks issue tracker?

lightonflux avatar Apr 13 '25 19:04 lightonflux

Don't worry about it, I control the Flatpak so if I really wanted to I could add the permission.

Of course if I did that it would have to go through review by the Flathub team, they would probably accept it but I'm still unsure if I want to add further permissions to Alpaca.

Jeffser avatar Apr 13 '25 19:04 Jeffser

My point is that the permission would allow changing adding network configuration, right? Afaik checking network state in a flatpak should be possible without the possibility to make hostile network config changes. And if there is no low permission way to check, maybe the flatpak devs should talk about it.

lightonflux avatar Apr 13 '25 19:04 lightonflux

Is it really useful as you will download the model only once and after that it will be offline and if you use api it does not use much data to show a banner it creates more complication. This is totally my view.

olumolu avatar Apr 13 '25 20:04 olumolu

Maybe this can be useful to also show error screens when the user goes to "Available Models" and they're completely offline.

Still, I'm not sure if I want to add another permission to Alpaca, I'll think about it

Jeffser avatar Apr 13 '25 21:04 Jeffser