Skip to content

[Bug] Some VPNs cause NetworkIcon to be invalid #199

@xytaglyph

Description

@xytaglyph

describe the bug

when enabling my VPN (ProtonVPN) the network icon changes to the symbol for no connection. if I disconnect from the VPN server it reverts to displaying the connection type properly.

from attempting to back-trace how the NetworkIcon is determined in the repo I found that the version of the netdev dependency that is used (0.24) does not properly resolve the interface for some VPN providers. you can easily reproduce this by creating a simple project with the 0.24 netdev dependency

use netdev::interface;

fn main() {
    dbg!(interface::get_interfaces());
    dbg!(interface::get_default_interface().unwrap());
}

when using the vpn, the above code lists all interfaces outside of the vpn interface. however, if you update the dependency to netdev 0.33 and run the same code block, it resolves properly and returns the InterfaceType called ProprietaryVirtual which is also not accounted for in the match statement in packages/desktop/src/providers/network/netdev_res.rs, understandably as it doesn't exist in netdev 0.24.

this change will also of course require the addition of another couple lines to the starter html, depending on how the match statement is built:

// Get icon to show for current network status.
function getNetworkIcon(networkOutput) {
    switch (networkOutput.defaultInterface?.type) {
            case 'ProprietaryVirtual':
              return <i className="nf nf-md-shield_lock_outline"></i>;
            case 'ethernet':
              return <i className="nf nf-md-ethernet_cable"></i>;
// . . .

i'm trying to figure out how to implement netdev 0.33 but this is literally my first github issue ever so please bear with me if anything here is incorrect.

reproduction

connect to a proprietary vpn provider
observe that the network icon changes from wifi/ethernet to no connection

stack trace or error logs (if applicable)

version number

v2.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions