Compare commits

..

4 Commits

Author SHA1 Message Date
czlonkowski
fcc423084a fix: add missing datatable methods to handlers-n8n-manager mock client
CI fails because handlers-manage-datatable.test.ts and handlers-n8n-manager.test.ts
share the same Vitest worker and module cache. The manage-datatable test mocks
N8nApiClient with 20 methods but handlers-n8n-manager only had 10. When running
in parallel, the singleton client state leaked between files causing mock mismatches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 23:26:39 +01:00
czlonkowski
ba1f9be984 fix: re-apply encodeURIComponent for filter/sortBy in handlers
The URL-encoding fixes were reverted by a concurrent agent. Re-applying
encodeURIComponent() for filter and sortBy in handleGetRows and
handleDeleteRows to match the test expectations and n8n API requirements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 22:35:56 +01:00
czlonkowski
a62e5f198c fix: case-insensitive 'not found' assertions in API client tests
N8nNotFoundError now passes through API messages directly instead of
wrapping them. The n8n API returns "Not found" (capital N) but tests
used .toContain('not found') (lowercase). Changed to case-insensitive.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 22:22:02 +01:00
czlonkowski
b0279bd11f fix: resolve 5 bugs in n8n_manage_datatable row operations and error handling
Fix critical issues found during staging QA testing:

1. data parameter serialization: MCP transport sends JSON as strings —
   added z.preprocess coercers (coerceJsonArray, coerceJsonObject,
   coerceJsonFilter) to parse string→JSON before Zod validation

2. filter/sortBy URL encoding: n8n API requires URL-encoded query params —
   added encodeURIComponent() for filter and sortBy in getRows/deleteRows

3. json column type: n8n API only accepts string|number|boolean|date —
   removed json from enum in types, Zod schema, tool definition, and docs

4. 404 error messages: N8nNotFoundError was wrapping API messages in
   "Resource with ID <message> not found" — now passes through cleanly

5. Unit test expectations updated for URL-encoded filter/sortBy values

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 22:03:07 +01:00

Diff Content Not Available