fix: remove dead try/catch in insertNode and fix SENSITIVE_PATHS case sensitivity#327
Merged
colbymchenry merged 2 commits intoMay 22, 2026
Conversation
… sensitivity
1. Remove no-op try/catch in QueryBuilder.insertNode() that just
re-throws the error without adding any value.
2. Fix SENSITIVE_PATHS case-sensitivity bug on Windows: the Set contained
PascalCase entries ('C:\\Windows') but the comparison used
resolved.toLowerCase(), which would never match. Normalize all entries
to lowercase so the comparison works correctly.
c510421 to
e5a06b1
Compare
Adds cross-platform coverage that POSIX system dirs are blocked, that a normal dir is allowed, and a Windows-gated case (C:\Windows vs c:\windows) that locks in the SENSITIVE_PATHS case-insensitivity fix.
e5a06b1 to
fefcaaf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Two small fixes:
1. Remove dead try/catch in
QueryBuilder.insertNode()src/db/queries.ts— The try/catch block aroundthis.stmts.insertNode.run()only re-throws the error, adding no value. Removed it to reduce noise.2. Fix
SENSITIVE_PATHScase-sensitivity bug on Windowssrc/utils.ts— TheSENSITIVE_PATHSSet contained PascalCase entries (C:\Windows) but the comparison usedresolved.toLowerCase(), so Windows paths would never match the sensitive path check.Normalized all entries to lowercase to fix the comparison.
Both fixes are minimal, low-risk code quality improvements.