Repository navigation
Conversation
Docker's bridges (br-<id>, docker0) and libvirt's virbr0 have addresses, so
they were listed as networks that never carry anything. A bridge is now
skipped when it is virtual and nothing but veths/taps are plugged into it.
Android USB tethering picks a random MAC each time the phone is plugged in,
so systemd names it enx<mac> afresh and its saved name and color were lost.
A USB network device now takes its id from the USB serial (usb:<serial>)
and its label from the device's product name ("SAMSUNG Android"). A serial
two devices share falls back to the device name, so ids stay unique.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne's USB serial id on top anmolkapil#32 now hides Docker bridges and veths in getLinuxAdapters, so this branch's own filtering is dropped. What's left: a USB adapter's id is usb:<serial>, so a tethered phone keeps its saved name and color across replugs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hi @anmolkapil, a gentle ping on this one when you get a chance 🙂
Happy to add a test over a fake |
anmolkapil#32 named the button after the network ("Edit Office fibre") instead of "Edit network", so the settings test couldn't find it and failed on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The E2E (smoke) failure was I added a small separate commit here that finds the button by its new name ( |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arpit-Khandelwal
left a comment
There was a problem hiding this comment.
Thanks for the clear write-up. Keying a tethered phone by its USB serial is a good idea. I checked readUsbSerial against a fake /sys tree (interface -> device link -> parent folder with serial) under Node, and it returns the serial as expected. Merged with main, typecheck, lint, format, the build and the ui/network/liveNetworks specs pass.
Two things before this can go in:
- Keep existing settings on upgrade. Saved names, colors, limits and (since #32) the per-network proxy are all keyed by
id. With this change, every Linux USB adapter that reports a serial gets a new id. That includes USB-Ethernet dongles whose name never changed, not only phones. Their saved settings disappear after the update, and a network that had a proxy would quietly go direct. Could you carry the old entry over? For example, when nothing is saved underusb:<serial>but something is saved under the device name, move it to the new id. - A test. Yes, please add the fake
/systest you offered. For example, letgetLinuxAdapters/readUsbSerialtake the sys root as a parameter, and cover: serial found, no serial, two adapters with the same serial, and the settings carry-over from point 1.
Also, #223 makes the same ui.spec.ts edit-button fix and conflicts with your test commit. Please drop that commit once #223 is merged.
| result.push({ | ||
| id: device, | ||
| // A tethered phone keeps its saved name and color across replugs (see readUsbSerial). | ||
| id: linuxAdapter?.usbSerial ? `usb:${linuxAdapter.usbSerial}` : device, |
There was a problem hiding this comment.
This changes the id for every Linux USB adapter with a serial, including USB-Ethernet dongles with a stable enx… name. Settings (name, color, limits, the #32 proxy) are keyed by this id, so they'd be lost on upgrade. Please move an entry saved under device to the new usb: id when there's none under the new one.
…and-phone-identity # Conflicts: # e2e/ui.spec.ts
Names, colors, limits and proxies are keyed by network id, so giving a USB adapter with a serial the id usb:<serial> would have lost them on upgrade, and a network with a proxy would have quietly gone direct. What's saved under the device name now moves to the new id when none is saved there. Main does it before the network is used, so it also happens with no window open; the window does the same to its copy, which it saves whole. getLinuxAdapters takes the sys root and moves out of interfaces.ts, which loads Electron, so it can be tested over a fake /sys tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Arpit-Khandelwal Thanks for the review! Addressed in 8515c9e:
One thing left as is: |
Why
On Linux, a phone shared over USB tethering loses its custom name and color every time it's plugged in. Android picks a random MAC for USB tethering on each connection, and systemd names the device from the MAC (
enx8e1dfa42a7fe, thenenx267c32d5a390, …). Network preferences are keyed byNetworkInterfaceInfo.id, which is the device name, so the name saved for the phone never matches it again.What changes
In
getLinuxAdapters(src/main/network/interfaces.ts), for an adapter it already classifies asusb:/sys/class/net/<dev>/device/../serial; the network function is…/usb1/1-2/1-2:1.0, and its parent1-2is the phone).idbecomesusb:<serial>(for exampleusb:RZCX12KDXRY). It stays the same across replugs, cables and ports, so saved names, colors and limits stick.deviceis still the real device name, soSO_BINDTODEVICEand routing are unchanged.0123456789ABCDEF, or one phone with two network functions), neither uses it, and both keep the device name as before.getLinuxAdaptersmoves tolinuxAdapters.tsand takes the sys root, so it can be tested without Electron.NetworkInterfaceInfo.iddoc comment insrc/shared/types.tssays so.Scope change: this PR first also hid Docker bridges. #32 has since done that in
getLinuxAdapters, so I mergedmainand dropped that part. What's left is only the phone's id.What it doesn't change
usb:<serial>id, unless that id already has settings. A phone last saved under an older randomenx…name can't be matched and has to be renamed once.network-usage.jsonisn't moved, so an adapter with a data limit starts its used amount from 0 once after upgrading.How I checked it
Manually, on Linux (Ubuntu, kernel 6.8), with Wi-Fi and a Samsung phone on USB tethering: before, each replug produced a new
enx…network with the default name. With the serial id,listActiveInterfaces()returned{ id: 'usb:RZCX12KDXRY', device: 'enx8e1dfa42a7fe', kind: 'usb' }, and the saved name came back after replugging. After merging #32, I re-ran discovery on the same machine with the phone unplugged: Wi-Fi is listed and the Docker bridges are filtered as before.Tests:
npm run lint,npm run typecheckandnpm run format:checkare clean.npm run test:e2e:smoke: 163 passed, 1 failed. The failure isui.spec.ts:137(minimum window keeps download controls…), which passes in CI and fails only on my display setup.e2e/linuxAdapters.spec.tsrunsgetLinuxAdaptersover a fake/systree (serial found, no serial, two adapters sharing a serial) and covers the settings carry-over.e2e/liveNetworks.spec.tschecks through the app that a saved name and proxy survive the id change.🤖 Generated with Claude Code