Fix multiple bugs across monitors, formatters, and views#7
Merged
Conversation
- Fix UInt64 overflow: cap rssKB before multiplying by 1024 in CPUMonitor - Fix health check always skipping: use 10s staleness threshold instead of same 30s as check interval - Fix post-eject disk refresh silently skipped by rate limiter: add force param to updateDisks() - Fix NSBitmapImageRep force-unwrap crash: use guard let in MacStatusBarApp and DiskContentView - Fix NSImage.copy() forced cast crash: use as? instead of as! in both files - Fix menuBarSpeed returning wrong unit "KB/s" for negative values: normalize to "B/s" like zero case - Fix duplicate RawRepresentable conformance on SpeedUnit: remove conformance clause from extension - Fix VPN traffic showing 0: add -t vpn to nettop arguments in NetworkMonitor Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-t vpn is not a valid nettop interface type — passing it caused nettop to print its help text instead of CSV data, making parseNettopOutput return empty results and speeds to always show 0. Replace -t wifi -t wired -t vpn with -t external, which nettop defines as all non-loopback interfaces (covers wifi, wired, and VPN tunnels). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each speed now displays the byte-rate (e.g. 1.2 MB/s) as the primary value with the bit-rate (e.g. 9.6 Mbps) below it in secondary style, making it easy to cross-reference with ISP speed ratings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rssKBbefore multiplying by 1024 in CPUMonitor to prevent silent integer overflow beforemin()can clamp itupdateDisks()call triggered after a successful disk eject; added aforceparameter to bypass itNSBitmapImageRepforce-unwrap crash: replaced!withguard let ... else { return NSImage() }inMacStatusBarAppandDiskContentViewNSImage.copy()forced cast crash: replacedas! NSImagewithas? NSImagein both filesmenuBarSpeed(-100)returned" 0 KB/s"while zero returned" 0 B/s"; normalized both to" 0 B/s"and updated the testRawRepresentableconformance:SpeedUnitdeclaredStringraw value (auto-synthesizing the conformance) and then re-declared it in an extension; removed the conformance clause from the extensionnettoponly queriedwifiandwiredinterfaces, silently ignoring VPN tunnels; added-t vpnTest plan
⌘B)⌘U) —testMenuBarSpeedNegativeupdated to assert" 0 B/s"🤖 Generated with Claude Code