-
Notifications
You must be signed in to change notification settings - Fork 51.4k
fix(core): Drop non-pooling sqlite driver #22280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 `'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).</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', () => { |
There was a problem hiding this comment.
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('should reject negative pool size', () => {
+ const config = Container.get(SqliteConfig);
+ expect(() => {
</file context>
✅ Addressed in f91f3e6
| expect(config.poolSize).toBe(3); | ||
| }); | ||
|
|
||
| test('should accept pool size of 1', () => { |
There was a problem hiding this comment.
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('should accept pool size of 1', () => {
+ const config = Container.get(SqliteConfig);
+ expect(config.poolSize).toBe(1);
</file context>
✅ Addressed in f91f3e6
| }; | ||
| } | ||
| return { | ||
| type: 'sqlite-pooled', |
There was a problem hiding this comment.
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 `'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).</comment>
<file context>
@@ -85,22 +85,14 @@ export class DbConnectionOptions {
- };
- }
+ return {
+ type: 'sqlite-pooled',
+ poolSize: sqliteConfig.poolSize,
+ enableWAL: true,
</file context>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This comment has been minimized.
This comment has been minimized.
|
E2E Tests: n8n tests passed after 9m 31.9s Run Details
Groups
This message was posted automatically by
currents.dev | Integration Settings
|
tomi
left a comment
There was a problem hiding this 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
Oh I wasn't aware of this. I thought the plan was to merge next week already. I'll redo it then. |
https://linear.app/n8n/issue/CAT-254