Skip to content

Fix 20 bugs from code review, add Vitest + unit tests - #37

Open
TheMarstonConnell wants to merge 1 commit into
mainfrom
fix/code-review-bugs
Open

Fix 20 bugs from code review, add Vitest + unit tests#37
TheMarstonConnell wants to merge 1 commit into
mainfrom
fix/code-review-bugs

Conversation

@TheMarstonConnell

Copy link
Copy Markdown
Member

Summary

  • Fix 5 critical bugs: init() swallowing failures, incomplete zip downloads, null getAsFile() crash, blockList using wrong operator, loadProviders early exit
  • Fix 9 high-priority bugs: delete/download typo, month off-by-one, Invalid Date, v-for index key, CoinGecko crash, misleading variable name, formatBytes infinite loop, FileTree uncaught throw, resize listener leak
  • Fix 6 medium issues: string throws → Error objects, any types → proper types, missing await, validation order, variable shadowing
  • Add Vitest with 63 unit tests covering src/helpers/util.ts

Details

Critical

# Bug File(s)
1 init() catches errors but returns them as resolved values; caller always sets ready.wallet = true jjs.ts, ConnectWallet.vue
2 Promise.allSettled swallows download failures, produces incomplete zip silently util.ts
3 getAsFile() returns File | null, cast to File hides null → crash during upload MainMiddleSection.vue
4 in operator checks array indices, not values — never blocks providers jjs.ts
5 return instead of continue exits entire function on first bad provider jjs.ts

High Priority

# Bug File(s)
6 confirmDelete toast says "download" instead of "delete" UtilityPopup.vue
7 getUTCMonth() returns 0-11, January displays as month 0 SingleShare.vue
8 new Date(undefined) creates Invalid Date before check SingleFile.vue, SingleShare.vue
9 :key="index" on sorted file list causes stale Vue state MainMiddleSection.vue
10 CoinGecko fetch has no error handling, crashes entire onMounted WalletInfo.vue
11 isShiftPressed actually tracks Meta key — renamed to isMetaPressed local.ts + 3 components
12 formatBytes() infinite loop on Infinity input util.ts
13 Top-level await with no try-catch blanks sidebar on error FileTree.vue
14 Resize event listener never cleaned up ViewFileDash.vue

Medium

# Fix File(s)
15 throw "string"throw new Error(...) (6 locations) jjs.ts, MainMiddleSection.vue, ViewFileDash.vue, CreateVault.vue
16 Replace any types with proper types WalletInfo.vue, jjs.ts, MainMiddleSection.vue, UtilityColumn.vue
17 Missing await on formatJklAmount() WalletInfo.vue
18 moveFile() validates after closing modal UtilityPopup.vue
19 Variable shadowing (const values twice) jjs.ts

Testing

  • Installed Vitest, created vitest.config.ts
  • 63 unit tests for src/helpers/util.ts covering all exported functions

Test plan

  • npm run build:prod passes with no TypeScript errors
  • npx vitest run — all 63 tests pass
  • Manual: wallet connection flow (connect → dashboard)
  • Manual: file tree loads properly
  • Manual: file upload and download work
  • Manual: share modal opens/closes correctly
  • Manual: public file view loads

🤖 Generated with Claude Code

Critical fixes: init() now throws on failure instead of swallowing errors,
DownloadFile reports failed downloads, null safety for getAsFile(), blockList
uses includes() instead of in operator, loadProviders uses continue instead
of return.

High-priority fixes: delete toast typo, month off-by-one, Invalid Date guard,
v-for key using ulid, CoinGecko error handling, isShiftPressed renamed to
isMetaPressed, formatBytes Infinity guard, FileTree try-catch, resize listener
cleanup.

Medium fixes: throw string→Error objects, any→proper types, await
formatJklAmount, moveFile validation before close, variable shadowing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify

netlify Bot commented Feb 12, 2026

Copy link
Copy Markdown

Deploy Preview for poetic-cheesecake-208edc ready!

Name Link
🔨 Latest commit a1e7cae
🔍 Latest deploy log https://app.netlify.com/projects/poetic-cheesecake-208edc/deploys/698e171f5df4ad00084f80d4
😎 Deploy Preview https://deploy-preview-37--poetic-cheesecake-208edc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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