π¦ Netfox 0.16.5 β the bug report that was wrong (mine)
π¦ Netfox 0.16.5 is out β and the bug I fixed wasn't the bug I filed.
Yesterday I logged this against my own app: sometimes the main window can't be reopened. Window β Netfox clicks through and does nothing. π€
Today I tried to reproduce it properly. Ten quit-and-relaunch cycles β the window came back 10/10. Close it, quit, relaunch β back. Not one failure.
So I'd been measuring the wrong thing. π΅οΈ There were two copies of Netfox running, and my check was reading the one whose window I'd closed instead of the one on screen. "Window β Netfox does nothing" because that menu belonged to the copy that already had its window open.
The window was never broken. π€¦
β οΈ But underneath the imaginary bug was a real one: two copies share the same stored device history while each keeps its own private view of it. They interfere β and on the previous version they brought each other down within a minute.
β So 0.16.5: Netfox refuses to run twice. Open it again and the copy already running comes forward; the new one steps aside before touching your data.
My favourite detail: deciding which copy stays is where the obvious answer is wrong. If each copy defers to the other one it can see, two copies launched together both politely quit and you're left with no app at all. π So every copy has to reach the same answer independently β oldest stays. I wrote the test, then broke the rule on purpose to check the test would notice. It reported zero survivors. π―
π The tally: forty lines of guard, nine corrections to get right, four of them mine and introduced while fixing the previous one.
π Free, universal, macOS 15.6+: https://netfox.app
What's the most misleading bug report you've ever written for yourself? I'll go first β mine's above. π


Replies
Publishing the wrong bug report alongside the fix is the useful half and almost nobody does it. The failure underneath yours is worth naming: your check assumed one instance, so it silently answered a different question than the one you asked. That is not a reproduction problem, it is that the measurement had an unstated precondition. Ten green runs against the wrong process look identical to ten green runs against the right one. The habit I have taken from getting this wrong repeatedly: before trusting a passing check, make it fail on purpose once. If you cannot make it go red deliberately, it was never testing what you thought. Would that have caught this one, or would forcing a failure still have hit the same stale instance?
Netfox
@rabnoor_sΒ Nope β and thats the interesting part.
Forcing it red would've worked and taught me nothing. Close the window, watch `count windows` drop to 0: perfectly correct answer from a check pointed at the wrong process. The stale instance really did have zero windows. It'd have gone red on cue and I'd have come away trusting it more.
Which is a line I hadn't drawn until you put it that way. Sensitivity and identity are different properties. Making a check fail proves it reacts to change; it doesn't prove it's watching the thing you named. It can be perfectly sensitive to the wrong object.
Your habit did earn its keep elsewhere in the same work though. The rule picking which copy survives has a test asserting exactly one does β I dropped in the naive "defer to the first other instance you can see" and got zero survivors back, which is the failure where both copies politely quit and you're left with no app running at all π . Pure sensitivity, and it's why I trust that test and not much else in there.
So imo they're sequential rather than either/or: make it fail on purpose, then ask what actually made it red. Cheap version of step two here was one line β count the processes before counting their windows.
And "unstated precondition" is the better name, mine was worse. "Wrong instrument" just tells you to distrust everything, which you can't act on. Yours tells you where to look.