Upgrade systeminformation to 5.x, clearing the last advisories - #7
Merged
Conversation
systeminformation is the extension's only production dependency and the only one that ships, and every version up to 5.31.6 carries command injection advisories -- eleven of them. Clearing those means 4.x to 5.x, which renames most of the surface this extension reads. npm audit now reports no vulnerabilities at all, down from eight. Four of the renames would have broken readings rather than merely changing them: - si.cpuCurrentspeed() no longer exists under that spelling; it is cpuCurrentSpeed(). Calling the old name throws, and ResMon.update() gathers every resource with Promise.all and has no error handling, so this would have frozen the whole status bar rather than just the CPU frequency. - currentLoad reports currentLoadIdle, currentLoadUser and currentLoadSystem where it used currentload_idle and friends. Reading the old names yields undefined, so the usage percentage would have rendered as NaN. - cpuTemperature reports null where there is no readable sensor, having previously reported -1. The check was for -1 exactly, so a Mac with no exposed sensor -- which includes Apple Silicon -- would have shown "null C". It now tests for a usable number rather than for either way of saying there isn't one. - battery reports hasBattery, isCharging, cycleCount, designedCapacity, maxCapacity, timeRemaining and acConnected in camelCase. fsSize() changed meaning rather than spelling, and for the better. Its "use" is now used over used-plus-available, which is what df reports, where it was used over size; on APFS those differ sharply because every volume in a container reports the container's size. v5 also reports "available" directly, so free space is no longer computed as size minus used, which on this machine claimed 37GB free where df said 9.9GB. All four disk formats were checked against df. Verified on an Apple M4 against system tools: CPU usage with its user and system split, per-core load bars, frequency, memory, swap and all four disk formats. The CPU temperature row is now correctly absent rather than reading "null C". This machine has no battery, so those field names were checked against the keys v5 actually returns rather than at runtime. The note about si.cpu() throwing on Apple Silicon is no longer true and has been corrected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
sachinsachdeva
force-pushed
the
chore/upgrade-systeminformation
branch
from
August 29, 2026 12:35
c7da00e to
50d5262
Compare
Merged
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.
systeminformationis the extension's only production dependency and the only one that ships. Every version up to 5.31.6 carries command-injection advisories — eleven of them. Clearing those means 4.x → 5.x, which renames most of the surface this extension reads.npm auditnow reports 0 vulnerabilities, down from 8 (1 critical, 5 high, 1 moderate, 1 low).Renames that would have broken readings, not merely changed them
si.cpuCurrentspeed()si.cpuCurrentSpeed()ResMon.update()gathers resources withPromise.alland has no error handling, so the entire status bar freezescurrentload_idleetc.currentLoadIdleetc.undefined→ usage renders asNaN%main === -1when absentmain === null!== -1, so a Mac with no sensor shows "null C"hasbattery,ischarging, …hasBattery,isCharging, …fsSize()changed meaning, and for the betteruseis now used ÷ (used + available) — whatdfreports — where it was used ÷ size. On APFS those differ sharply, because every volume in a container reports the container's size. v5 also exposesavailabledirectly, so free space is no longer computed assize - used:The old figures were wrong, not merely different. All four
disk.formatmodes were checked againstdf.Verification
Run on an Apple M4 against system tools:
21.59% (13.94% user, 7.65% system)▄▃▂▂▂▁▂▂▂▂ peak 45% on core 02.40 GHznull C14.16 GB of 16.00 GB (88.48%), swap6.21 GB of 7.00 GBdf(4.89%remaining,9.80 GBfree)48 tests pass,
npm run lintclean, and the extension was smoke-tested through a mockedvscodemodule with every section rendering and the host exiting cleanly.Caveat worth knowing: this machine has no battery, so those code paths could not be exercised at runtime. Instead every property the code reads off
battery()was cross-checked against the keys v5 actually returns — all seven present. That is weaker than a live check, and a reviewer on a laptop could confirm it in a moment.Also corrected: the comment claiming
si.cpu()throws on Apple Silicon. It no longer does.🤖 Generated with Claude Code