mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-09 23:03:12 +00:00
fix: address code review issues for PR #467
- Add 5-minute TTL to version cache (prevents stale data after upgrades) - Add type validation for version string from settings response - Support 'v' prefix in version strings (e.g., v1.2.3) - Fix race condition in getVersion() using promise-based locking - Fix empty settings regression (Issue #431) - use minimal defaults 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -181,9 +181,17 @@ export function cleanWorkflowForUpdate(workflow: Workflow): Partial<Workflow> {
|
||||
filteredSettings[key] = value;
|
||||
}
|
||||
}
|
||||
cleanedWorkflow.settings = filteredSettings;
|
||||
// If no valid properties remain after filtering, use minimal defaults
|
||||
// Issue #431: n8n API rejects empty settings objects
|
||||
if (Object.keys(filteredSettings).length > 0) {
|
||||
cleanedWorkflow.settings = filteredSettings;
|
||||
} else {
|
||||
// Minimal valid settings - executionOrder v1 is the modern default
|
||||
cleanedWorkflow.settings = { executionOrder: 'v1' as const };
|
||||
}
|
||||
} else {
|
||||
cleanedWorkflow.settings = {};
|
||||
// No settings provided - use minimal valid defaults
|
||||
cleanedWorkflow.settings = { executionOrder: 'v1' as const };
|
||||
}
|
||||
|
||||
return cleanedWorkflow;
|
||||
|
||||
Reference in New Issue
Block a user