Commit b8eaf5d
networkmanager: Show error when connecting without stored password
When connecting to a Wi-Fi network with a saved connection but no stored
password (no `psk=` in `.nmconnection` file), the Networking page did
not show any error or other visible status change.
Sadly, the NetworkManager API does not make this easy: It transitions
through device states (via D-Bus signals) very quickly (PREPARE →
CONFIG → NEED_AUTH → FAILED → DISCONNECTED), and React batches all these
property updates together. By the time the `useEffect` runs, the device
has already returned to DISCONNECTED state and the interesting failure
reason (NM_DEVICE_STATE_REASON_NO_SECRETS) already was reset and the
state is just NM_DEVICE_STATE_DISCONNECTED.
Fix this by capturing the failure reason in the D-Bus signal handler and
storing it on the device object. The UI can then retrieve and consume
this cached reason when checking for failures.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent a97eaff commit b8eaf5d
File tree
3 files changed
+90
-4
lines changed- pkg/networkmanager
- test/verify
3 files changed
+90
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
| 335 | + | |
| 336 | + | |
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
| |||
399 | 400 | | |
400 | 401 | | |
401 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
402 | 418 | | |
403 | 419 | | |
404 | 420 | | |
| |||
1150 | 1166 | | |
1151 | 1167 | | |
1152 | 1168 | | |
| 1169 | + | |
1153 | 1170 | | |
1154 | 1171 | | |
1155 | 1172 | | |
| |||
1170 | 1187 | | |
1171 | 1188 | | |
1172 | 1189 | | |
| 1190 | + | |
1173 | 1191 | | |
1174 | 1192 | | |
1175 | 1193 | | |
1176 | 1194 | | |
1177 | 1195 | | |
1178 | 1196 | | |
1179 | 1197 | | |
| 1198 | + | |
1180 | 1199 | | |
1181 | 1200 | | |
1182 | 1201 | | |
| |||
1203 | 1222 | | |
1204 | 1223 | | |
1205 | 1224 | | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1206 | 1232 | | |
1207 | 1233 | | |
1208 | 1234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| 278 | + | |
277 | 279 | | |
278 | 280 | | |
279 | 281 | | |
| |||
291 | 293 | | |
292 | 294 | | |
293 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
294 | 323 | | |
295 | 324 | | |
296 | 325 | | |
| |||
861 | 890 | | |
862 | 891 | | |
863 | 892 | | |
| 893 | + | |
864 | 894 | | |
865 | | - | |
866 | | - | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
867 | 900 | | |
868 | 901 | | |
869 | 902 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
229 | 256 | | |
230 | 257 | | |
231 | 258 | | |
| |||
0 commit comments