You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are valid concerns raised by reviewers on #77 that were out of scope for the perf iteration cycle and are tracked here for a follow-up PR. The perf work in #77 delivered the measured wins (Single −53 %, Subset −40 %, AlreadyInstalled −99 %); this issue captures the correctness/robustness polish layered on top.
Tasks
Variant-aware skip-installed shortcut. Today the skip check matches $family -like "$fontName*", so Install-NerdFont -Name Hack -Variant Mono skips when any Hack family (e.g. standard or Propo) is installed even if the Mono files are absent. Either include the requested variant in the match, or only apply the shortcut when -Variant All.
Tighten -Variant Mono test. The current test asserts only that some Hack font is installed. Add assertions that only Mono families/files are present and Standard/Propo variants are absent.
Unit tests for skip-installed and dedup paths. Mock Get-Font and the download call to assert that (a) an already-installed family skips the network call without -Force, (b) -Force still downloads, and (c) overlapping -Name inputs (wildcard + exact) download/install the matching font only once.
-WhatIf semantics. Several new paths regress -WhatIf:
Cache-hit copy runs without a ShouldProcess check, so -WhatIf still copies the cached zip into temp.
Downloads are queued before ShouldProcess, so -WhatIf still opens HTTP connections and may write cache files.
Variant filtering walks $extractPath even when extraction was skipped, producing errors under -WhatIf.
Gate each of these on the existing ShouldProcess decisions, or include them under the same approved operation block.
Download retries. Switching from Invoke-WebRequest -RetryIntervalSec 5 -MaximumRetryCount 5 to raw HttpClient.GetByteArrayAsync removed the existing retry behaviour for transient CDN/GitHub errors. Add an equivalent retry loop around each HTTP request.
Per-font extraction error handling.ZipFile.ExtractToDirectory throws a terminating exception for corrupt archives or invalid entries, aborting the entire batch. Wrap per-font extraction in try/catch, report the failing font, and continue.
Bounded streaming for -All. Each download buffers the whole archive into memory via GetByteArrayAsync. With -All that can mean hundreds of MB resident. Stream each response directly to disk while keeping the existing throttle of 8.
Cache root platform conventions. macOS currently uses $HOME/.cache/PSModule/NerdFonts instead of $HOME/Library/Caches/PSModule/NerdFonts, and Linux ignores $Env:XDG_CACHE_HOME. Branch on $IsMacOS and $Env:XDG_CACHE_HOME when constructing the cache root.
Perf harness Subset-AlreadyInstalled precondition. If the preceding Subset install fails, the Subset-AlreadyInstalled scenario silently measures a cold install. Make the setup explicitly ensure the subset is installed (or skip the scenario) instead of relying on the previous run.
Origin
Raised across review comments on #77; deferred from that PR because the iteration cycle and prerelease measurements were already complete and these items belong to a separate review-able change.
Install-NerdFont: follow-ups from PR #77 review
These are valid concerns raised by reviewers on #77 that were out of scope for the perf iteration cycle and are tracked here for a follow-up PR. The perf work in #77 delivered the measured wins (Single −53 %, Subset −40 %, AlreadyInstalled −99 %); this issue captures the correctness/robustness polish layered on top.
Tasks
$family -like "$fontName*", soInstall-NerdFont -Name Hack -Variant Monoskips when any Hack family (e.g. standard or Propo) is installed even if the Mono files are absent. Either include the requested variant in the match, or only apply the shortcut when-Variant All.-Variant Monotest. The current test asserts only that some Hack font is installed. Add assertions that only Mono families/files are present and Standard/Propo variants are absent.Get-Fontand the download call to assert that (a) an already-installed family skips the network call without-Force, (b)-Forcestill downloads, and (c) overlapping-Nameinputs (wildcard + exact) download/install the matching font only once.-WhatIfsemantics. Several new paths regress-WhatIf:ShouldProcesscheck, so-WhatIfstill copies the cached zip into temp.ShouldProcess, so-WhatIfstill opens HTTP connections and may write cache files.$extractPatheven when extraction was skipped, producing errors under-WhatIf.Gate each of these on the existing
ShouldProcessdecisions, or include them under the same approved operation block.Invoke-WebRequest -RetryIntervalSec 5 -MaximumRetryCount 5to rawHttpClient.GetByteArrayAsyncremoved the existing retry behaviour for transient CDN/GitHub errors. Add an equivalent retry loop around each HTTP request.ZipFile.ExtractToDirectorythrows a terminating exception for corrupt archives or invalid entries, aborting the entire batch. Wrap per-font extraction intry/catch, report the failing font, and continue.-All. Each download buffers the whole archive into memory viaGetByteArrayAsync. With-Allthat can mean hundreds of MB resident. Stream each response directly to disk while keeping the existing throttle of 8.$HOME/.cache/PSModule/NerdFontsinstead of$HOME/Library/Caches/PSModule/NerdFonts, and Linux ignores$Env:XDG_CACHE_HOME. Branch on$IsMacOSand$Env:XDG_CACHE_HOMEwhen constructing the cache root.Subset-AlreadyInstalledprecondition. If the precedingSubsetinstall fails, theSubset-AlreadyInstalledscenario silently measures a cold install. Make the setup explicitly ensure the subset is installed (or skip the scenario) instead of relying on the previous run.Origin
Raised across review comments on #77; deferred from that PR because the iteration cycle and prerelease measurements were already complete and these items belong to a separate review-able change.