fix: resolve sql.js adapter bypass in NodeRepository constructor (Issue #296)

Changes duck typing ('db' in object) to instanceof check for precise type discrimination.
Only unwraps SQLiteStorageService instances, preserving DatabaseAdapter wrappers intact.

Fixes MCP tool failures (get_node_essentials, get_node_info, validate_node_operation)
on systems using sql.js fallback (Node.js version mismatches, ARM architectures).

- Changed: NodeRepository constructor to use instanceof SQLiteStorageService
- Fixed: sql.js queries now flow through SQLJSAdapter wrapper properly
- Impact: Empty object returns eliminated, proper data normalization restored

Closes #296

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-10-09 22:24:40 +02:00
parent 51278f52e9
commit 36eb8e3864
3 changed files with 81 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "n8n-mcp",
"version": "2.18.3",
"version": "2.18.4",
"description": "Integration between n8n workflow automation and Model Context Protocol (MCP)",
"main": "dist/index.js",
"bin": {