Astal icon indicating copy to clipboard operation
Astal copied to clipboard

Some properties on AstalNetwork.wifi occasionally break

Open Mabi19 opened this issue 1 year ago • 3 comments

Describe the bug Occasionally, the ssid and icon_name properties on AstalNetwork.wifi will break, returning null and the empty wifi icon respectively until the app is restarted. Some assertions will also fail and be printed in the console periodically. screenshot of broken wifi widget

Failed assertions

** (gjs:33556): CRITICAL **: 19:55:20.034: astal_network_access_point_get_bandwidth: assertion 'self != NULL' failed
** (gjs:33556): CRITICAL **: 19:55:20.034: astal_network_access_point_get_frequency: assertion 'self != NULL' failed
** (gjs:33556): CRITICAL **: 19:55:20.034: astal_network_access_point_get_strength: assertion 'self != NULL' failed
** (gjs:33556): CRITICAL **: 19:55:20.034: astal_network_access_point_get_ssid: assertion 'self != NULL' failed
(gjs:33556): GLib-GObject-CRITICAL **: 19:55:20.034: invalid (NULL) pointer instance
(gjs:33556): GLib-GObject-CRITICAL **: 19:55:20.034: g_signal_connect_object: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

To Reproduce Using even a simple wifi widget like the one below breaks.

export const TestWifi = () => {
    return (
        <box spacing={4}>
            <icon icon={bind(network.wifi, "icon_name")} />
            {bind(network.wifi, "internet").as((state) => {
                if (state == AstalNetwork.Internet.DISCONNECTED) {
                    return <label label="D/C" />;
                } else {
                    return <label label={bind(network.wifi, "ssid")} />;
                }
            })}
        </box>
    );
};

Expected behavior The widget shouldn't break after being on for enough time

Additional context This is likely hardware dependent. It's happening for me both on a cheap USB wifi adapter and an Intel AX200-based PCI-e network card, so it's probably not that, though.

Mabi19 avatar Nov 13 '24 19:11 Mabi19

I've done a little network debugging, and this sometimes happens when disconnecting from the network (My PC is in a somewhat unfortunate place relative to my router, so it disconnects occasionally). However, even though it can usually reconnect in a few seconds, the properties stay broken for a while (usually until I restart my setup, but rarely it does come back on by itself which is. Weird.)

Mabi19 avatar Feb 03 '25 09:02 Mabi19

I have a similar problem. This is still relevant, right?

thomas-btst avatar Sep 25 '25 15:09 thomas-btst

#424 Might be relevant

navidmafi avatar Nov 14 '25 07:11 navidmafi