Skip to content

Conversation

@ivov
Copy link
Member

@ivov ivov commented Nov 25, 2025

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Nov 25, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 9 files

Prompt for AI agents (all 3 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/@n8n/config/src/configs/__tests__/database.config.test.ts">

<violation number="1" location="packages/@n8n/config/src/configs/__tests__/database.config.test.ts:25">
`poolSize` defaults to 3, so this test falsely assumes a default of 1 and will always fail.</violation>

<violation number="2" location="packages/@n8n/config/src/configs/__tests__/database.config.test.ts:37">
`config.poolSize = -1` never throws, so this test is guaranteed to fail.</violation>
</file>

<file name="packages/@n8n/db/src/connection/db-connection-options.ts">

<violation number="1" location="packages/@n8n/db/src/connection/db-connection-options.ts:89">
Rule violated: **Tests**

Community PR Guidelines §2 require PRs to include tests covering core changes. The new default pooled SQLite connection (type `&#39;sqlite-pooled&#39;`) lacks an updated unit test—existing tests still expect the legacy `&#39;sqlite&#39;` driver when poolSize is 0—so the critical DB selection change is currently untested. Update the sqlite connection tests to assert the new default pooled behavior (including poolSize edge cases).</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

}).toThrow();
});

test('should reject negative pool size', () => {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config.poolSize = -1 never throws, so this test is guaranteed to fail.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/@n8n/config/src/configs/__tests__/database.config.test.ts, line 37:

<comment>`config.poolSize = -1` never throws, so this test is guaranteed to fail.</comment>

<file context>
@@ -1,39 +1,51 @@
+			}).toThrow();
+		});
+
+		test(&#39;should reject negative pool size&#39;, () =&gt; {
+			const config = Container.get(SqliteConfig);
+			expect(() =&gt; {
</file context>

✅ Addressed in f91f3e6

expect(config.poolSize).toBe(3);
});

test('should accept pool size of 1', () => {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

poolSize defaults to 3, so this test falsely assumes a default of 1 and will always fail.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/@n8n/config/src/configs/__tests__/database.config.test.ts, line 25:

<comment>`poolSize` defaults to 3, so this test falsely assumes a default of 1 and will always fail.</comment>

<file context>
@@ -1,39 +1,51 @@
+			expect(config.poolSize).toBe(3);
+		});
+
+		test(&#39;should accept pool size of 1&#39;, () =&gt; {
+			const config = Container.get(SqliteConfig);
+			expect(config.poolSize).toBe(1);
</file context>

✅ Addressed in f91f3e6

};
}
return {
type: 'sqlite-pooled',
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule violated: Tests

Community PR Guidelines §2 require PRs to include tests covering core changes. The new default pooled SQLite connection (type 'sqlite-pooled') lacks an updated unit test—existing tests still expect the legacy 'sqlite' driver when poolSize is 0—so the critical DB selection change is currently untested. Update the sqlite connection tests to assert the new default pooled behavior (including poolSize edge cases).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/@n8n/db/src/connection/db-connection-options.ts, line 89:

<comment>Community PR Guidelines §2 require PRs to include tests covering core changes. The new default pooled SQLite connection (type `&#39;sqlite-pooled&#39;`) lacks an updated unit test—existing tests still expect the legacy `&#39;sqlite&#39;` driver when poolSize is 0—so the critical DB selection change is currently untested. Update the sqlite connection tests to assert the new default pooled behavior (including poolSize edge cases).</comment>

<file context>
@@ -85,22 +85,14 @@ export class DbConnectionOptions {
-			};
-		}
+		return {
+			type: &#39;sqlite-pooled&#39;,
+			poolSize: sqliteConfig.poolSize,
+			enableWAL: true,
</file context>
Fix with Cubic

@ivov ivov added the v2-prep label Nov 25, 2025
@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 58.33333% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...s/@n8n/db/src/repositories/execution.repository.ts 0.00% 3 Missing ⚠️
...ckages/@n8n/db/src/repositories/role.repository.ts 0.00% 1 Missing ⚠️
packages/cli/src/server.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@blacksmith-sh

This comment has been minimized.

@ivov ivov requested a review from tomi November 25, 2025 16:08
@currents-bot
Copy link

currents-bot bot commented Nov 25, 2025

E2E Tests: n8n tests passed after 9m 31.9s

🟢 588 · 🔴 0 · ⚪️ 12 · 🟣 3

View Run Details

Run Details

  • Project: n8n

  • Groups: 2

  • Framework: Playwright

  • Run Status: Passed

  • Commit: 90822e9

  • Spec files: 96

  • Overall tests: 600

  • Duration: 9m 31.9s

  • Parallelization: 9

Groups

GroupId Results Spec Files Progress
ui 🟢 539 · 🔴 0 · ⚪️ 12 · 🟣 3 90 / 90
ui:isolated 🟢 49 · 🔴 0 · ⚪️ 0 6 / 6


This message was posted automatically by currents.dev | Integration Settings

Copy link
Collaborator

@tomi tomi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep the changes to minimum until we actually merge the v2-dev branch to avoid conflicts as much as possible? The branch is somewhat long-lived with a lot of incoming changes, so there's a potential risk of having to deal with conflicts. We could leave isLegacySqlite for now on the database.config.ts but hardcode it to false. We can then cleanup after we have merged the dev branch

@ivov
Copy link
Member Author

ivov commented Nov 26, 2025

Can we keep the changes to minimum until we actually merge the v2-dev branch to avoid conflicts as much as possible? The branch is somewhat long-lived with a lot of incoming changes, so there's a potential risk of having to deal with conflicts. We could leave isLegacySqlite for now on the database.config.ts but hardcode it to false. We can then cleanup after we have merged the dev branch

Oh I wasn't aware of this. I thought the plan was to merge next week already. I'll redo it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team v2-prep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants