Skip to content

fix: use KB instead of bytes in config file size warning#990

Open
LongOddCode wants to merge 1 commit intoAzure:mainfrom
LongOddCode:fix/issue-973-kb-unit-in-warning
Open

fix: use KB instead of bytes in config file size warning#990
LongOddCode wants to merge 1 commit intoAzure:mainfrom
LongOddCode:fix/issue-973-kb-unit-in-warning

Conversation

@LongOddCode
Copy link
Copy Markdown
Contributor

Fixes #973

Problem

When staticwebapp.config.json exceeds the maximum allowed size (20 KB), the warning message incorrectly displays the unit as "bytes" instead of "KB":

WARNING: staticwebapp.config.json is 22 bytes. The maximum size is 20 bytes.

The values shown (22, 20) are already in kilobytes (the variable is fileSizeInKb and the constant is SWA_RUNTIME_CONFIG_MAX_SIZE_IN_KB), but the label says "bytes".

Fix

Changed the warning message in src/core/utils/user-config.ts to use "KB" instead of "bytes":

WARNING: staticwebapp.config.json is 22 KB. The maximum size is 20 KB.

Testing

Added a test case in src/core/utils/user-config.spec.ts that verifies:

  • The warning message contains "KB"
  • The warning message does not contain "bytes"

All existing tests continue to pass.

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.

kb mistaken for bytes in warning

1 participant