Some properties on AstalNetwork.wifi occasionally break
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.
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.
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.)
I have a similar problem. This is still relevant, right?
#424 Might be relevant