Skip to content

Conversation

@nulone
Copy link

@nulone nulone commented Jan 10, 2026

Description

formatSize() returned "NaN B" for negative byte values. Now returns "0 B" since file sizes cannot be negative.

Server Details

  • Server: filesystem
  • Changes to: lib.ts, lib.test.ts

Motivation and Context

Invalid input should not produce "NaN B" in UI.

How Has This Been Tested?

  • Build passes
  • Updated existing test to verify new behavior

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Return '0 B' for negative byte values instead of 'NaN B'.
File sizes cannot be negative, so this is a safe default.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant