Fixes validator crash on NaN summary size for symlinked datasets - #443
Fixes validator crash on NaN summary size for symlinked datasets#443brainy-joseph wants to merge 7 commits into
Conversation
|
I think we probably want to fix this by avoiding adding I'm guessing the |
Refactor file size accumulation to check for finite values.
Hi @effigies , I have now updated the PR to fix this at the source! I reverted the display only update in output.ts and instead added a Number.isFinite check in src/summary/summary.ts where the size is accumulated. This way, valid file sizes are still counted but NaN values from broken symlinks are skipped. Let me know if this looks good! |
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #443 +/- ##
=======================================
Coverage 87.73% 87.74%
=======================================
Files 65 65
Lines 4843 4846 +3
Branches 789 789
=======================================
+ Hits 4249 4252 +3
Misses 502 502
Partials 92 92 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
effigies
left a comment
There was a problem hiding this comment.
Could you add a small change log entry? See the contributing guide for how to use scriv.
@effigies Read the Contribution Guide and added the changelog entry manually via GitHub as I am currently out of my city. I hope that was what you were looking for. Let me know if any changes are needed! :) |
Prevent crash described in Issue #411
When a dataset contains symlinks,
summary.sizecan be NaN, andprettyBytes(from @std/fmt/bytes) throws "TypeError: Expected a finite number, got number: NaN", crashing the validator at its summary step.This guards the value with
Number.isFinite, falling back to 0 so the summary always renders. Display only change and has no validation logic touched. Thank you! :D