Skip to content

feat(editor): Add SQLite WASM integration with useDatabase and run-data workers (no-changelog)#1

Open
tomerqodo wants to merge 1 commit into
base-sqlite-wasmfrom
feat/sqlite-wasm-run-data-worker
Open

feat(editor): Add SQLite WASM integration with useDatabase and run-data workers (no-changelog)#1
tomerqodo wants to merge 1 commit into
base-sqlite-wasmfrom
feat/sqlite-wasm-run-data-worker

Conversation

@tomerqodo

Copy link
Copy Markdown

Summary

This pull request introduces a new SQLite database integration to the frontend editor UI using the @sqlite.org/sqlite-wasm package. The changes include setting up configuration and initialization logic for the database, and implementing the boilerplate code for a worker for managing run data storage. The code is currently unused, and will be introduced using a feature flag.

Database Integration

  • Implemented the useDatabase utility in src/workers/database/useDatabase.ts to initialize and manage the SQLite database using a Web Worker.
  • Defined the database configuration and schema for the executions table in src/workers/run-data/db.ts.
  • Created a run data worker using Comlink to interact with the database from the frontend, including initialization logic in src/workers/run-data/worker.ts and worker instantiation in src/workers/run-data/instance.ts.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/CAT-1273/add-database-code-and-worker-initialization

@tomerqodo tomerqodo changed the base branch from master to base-sqlite-wasm March 17, 2026 08:00
@tomerqodo tomerqodo force-pushed the feat/sqlite-wasm-run-data-worker branch from 9233d87 to 2a9e0e7 Compare March 17, 2026 08:02
@tomerqodo

Copy link
Copy Markdown
Author

/agentic_review

@qodo-code-review

qodo-code-review Bot commented Mar 17, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (7) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX Issues (0)

Grey Divider


Action required

1. Workspace importer removed 🐞 Bug ☼ Reliability
Description
pnpm-lock.yaml deletes the importer entry for packages/@n8n/scan-community-package even though
that workspace package and its dependencies still exist, leaving the lockfile inconsistent with the
workspace manifests.
Code

pnpm-lock.yaml[L1255-1272]

-  packages/@n8n/scan-community-package:
-    dependencies:
-      axios:
-        specifier: 'catalog:'
-        version: 1.8.3
-      eslint:
-        specifier: 'catalog:'
-        version: 9.29.0(jiti@1.21.7)
-      fast-glob:
-        specifier: 'catalog:'
-        version: 3.2.12
-      semver:
-        specifier: ^7.5.4
-        version: 7.7.2
-      tmp:
-        specifier: 0.2.4
-        version: 0.2.4
-
Evidence
The lockfile importer is removed in this PR, but pnpm-workspace.yaml still includes
packages/@n8n/* and packages/@n8n/scan-community-package/package.json still declares the package
and dependencies.

pnpm-lock.yaml[1255-1272]
pnpm-workspace.yaml[1-4]
packages/@n8n/scan-community-package/package.json[1-16]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `packages/@n8n/scan-community-package` importer stanza was removed from `pnpm-lock.yaml` while the package still exists in the workspace, making the lockfile stale/incomplete.
### Issue Context
`pnpm-workspace.yaml` includes `packages/@n8n/*`, and `packages/@n8n/scan-community-package/package.json` still declares dependencies.
### Fix Focus Areas
- pnpm-lock.yaml[1255-1272]
- pnpm-workspace.yaml[1-4]
- packages/@n8n/scan-community-package/package.json[1-16]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Bad worker URL 🐞 Bug ≡ Correctness
Description
The run-data worker is instantiated with a URL that resolves to a non-existent path
(./run-data/worker.ts relative to run-data/instance.ts), so Worker creation will fail at
runtime.
Code

packages/frontend/editor-ui/src/workers/run-data/instance.ts[R4-6]

+const worker = new Worker(new URL('./run-data/worker.ts', import.meta.url), {
+	type: 'module',
+});
Evidence
instance.ts is already inside src/workers/run-data/, so adding ./run-data/ duplicates the
directory and points to a file that does not exist. The repo’s existing worker instantiation pattern
uses a relative path that does not re-include the containing directory name.

packages/frontend/editor-ui/src/workers/run-data/instance.ts[4-6]
packages/frontend/editor-ui/src/workers/run-data/worker.ts[1-3]
packages/frontend/editor-ui/src/plugins/codemirror/typescript/client/useTypescript.ts[41-44]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The run-data worker URL is constructed as `./run-data/worker.ts` from within `src/workers/run-data/instance.ts`, which resolves to `src/workers/run-data/run-data/worker.ts` and fails to load.
### Issue Context
`instance.ts` and `worker.ts` are in the same directory.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/instance.ts[4-6]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Worker not Comlink-exposed 🐞 Bug ≡ Correctness
Description
The run-data worker exports actions but never calls Comlink.expose(), so Comlink.wrap() in the
main thread will not be able to invoke initialize().
Code

packages/frontend/editor-ui/src/workers/run-data/worker.ts[R13-22]

+export const actions = {
+	async initialize() {
+		const { promiser, dbId } = await useDatabase(databaseConfig);
+
+		state.promiser = promiser;
+		state.dbId = dbId;
+	},
+};
+
+export type RunDataWorker = typeof actions;
Evidence
The instance uses Comlink.wrap(worker) which requires the worker side to call
Comlink.expose(...). The codebase’s existing Comlink worker does this explicitly, but the new
run-data worker does not.

packages/frontend/editor-ui/src/workers/run-data/instance.ts[1-8]
packages/frontend/editor-ui/src/workers/run-data/worker.ts[13-22]
packages/frontend/editor-ui/src/plugins/codemirror/typescript/worker/typescript.worker.ts[224-224]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The run-data worker is wrapped via Comlink on the main thread but never exposes any API via `Comlink.expose()`, so RPC calls will fail.
### Issue Context
There is an established Comlink pattern in the repo (`typescript.worker.ts`) that calls `Comlink.expose(...)`.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/worker.ts[1-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (3)
4. Wrong JSON check column 🐞 Bug ≡ Correctness
Description
The executions.workflow column CHECK constraint validates json_valid(data) instead of
json_valid(workflow), allowing invalid JSON to be stored in workflow.
Code

packages/frontend/editor-ui/src/workers/run-data/db.ts[R11-15]

+          workflow_id INTEGER NOT NULL,
+          data TEXT CHECK (json_valid(data)) NOT NULL,
+          workflow TEXT CHECK (json_valid(data)) NOT NULL,
+          created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+        );
Evidence
The schema’s workflow column constraint references the data column, making it ineffective at
validating the workflow column contents.

packages/frontend/editor-ui/src/workers/run-data/db.ts[9-15]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`workflow` column validation is incorrectly checking `data` instead of `workflow`, so invalid JSON can be persisted.
### Issue Context
Both `data` and `workflow` are intended to be JSON strings.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/db.ts[11-15]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Unchecked promiser error results 🐞 Bug ≡ Correctness
Description
useDatabase() does not validate config-get or exec responses for type: 'error' and
force-casts dbId to string even though it can be undefined, so initialization can proceed with
invalid state.
Code

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[R28-42]

+	const cfg = await promiser('config-get', {});
+	const openResponse = await promiser('open', {
+		filename: config.filename,
+	});
+
+	if (openResponse.type === 'error') {
+		throw new Error(openResponse.result.message);
+	}
+
+	dbId = openResponse.result.dbId as string;
+
+	await promiser('exec', {
+		dbId,
+		sql: config.tables.executions.schema,
+	});
Evidence
The promiser return type is explicitly a success-or-error union, but useDatabase() only checks for
errors on open. It also casts dbId from string | undefined to string without validation, and
ignores whether exec returned an error response.

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[28-42]
packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[14-16]
packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[84-91]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`useDatabase()` treats promiser calls as always-successful (except `open`) even though the declared response type is a success/error union, and it force-casts possibly-undefined `dbId`.
### Issue Context
The type definition for the sqlite-wasm promiser explicitly models error responses (`type: 'error'`).
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[28-42]
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[14-16]
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[84-91]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Wrong Worker type definition 🐞 Bug ≡ Correctness
Description
The ambient @sqlite.org/sqlite-wasm typings import Worker from node:worker_threads, which is
incompatible with browser Web Workers and will prevent correctly typing a DOM Worker for
sqlite3Worker1Promiser() configuration.
Code

packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[R1-12]

+import type { Worker } from 'node:worker_threads';
+
+declare module '@sqlite.org/sqlite-wasm' {
+	type OnreadyFunction = () => void;
+
+	export type Sqlite3Worker1PromiserConfig = {
+		onready?: OnreadyFunction;
+		worker?: Worker | (() => Worker);
+		generateMessageId?: (messageObject: unknown) => string;
+		debug?: (...args: any[]) => void;
+		onunhandled?: (event: MessageEvent) => void;
+	};
Evidence
Editor-ui is compiled with DOM libs, and the codebase uses browser Workers. The sqlite-wasm ambient
declaration instead types the worker option using Node’s worker_threads Worker, which is not
assignable from a DOM Worker and may also require Node module type resolution in a frontend build.

packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[1-12]
packages/@n8n/typescript-config/tsconfig.frontend.json[9-11]
packages/frontend/editor-ui/src/plugins/codemirror/typescript/client/useTypescript.ts[42-44]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The sqlite-wasm ambient typings are using Node's `worker_threads` Worker type, which is incompatible with the DOM Worker type used in the editor UI.
### Issue Context
editor-ui compiles with DOM libs and uses browser workers.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[1-12]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

7. Hardcoded executions table init 🐞 Bug ⚙ Maintainability
Description
useDatabase() always runs config.tables.executions.schema instead of initializing all configured
tables, so adding any other table to DatabaseConfig.tables will be ignored and omitting
executions will crash. This contradicts the generic Record config shape.
Code

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[R39-42]

+	await promiser('exec', {
+		dbId,
+		sql: config.tables.executions.schema,
+	});
Evidence
DatabaseConfig.tables is a generic record, but useDatabase() assumes a specific executions key
and never iterates through the configured tables.

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[9-12]
packages/frontend/editor-ui/src/workers/database/useDatabase.ts[39-42]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Database initialization is hardcoded to the `executions` table despite `tables` being a generic record.
### Fix
Iterate over `Object.values(config.tables)` (or entries) and execute each table's `schema` with `promiser('exec', ...)`.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[9-12]
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[39-42]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Grey Divider

Previous review results

Review updated until commit 2a9e0e7

Results up to commit 2a9e0e7


🐞 Bugs (7) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX Issues (0)

Grey Divider
Action required
1. Workspace importer removed 🐞 Bug ☼ Reliability
Description
pnpm-lock.yaml deletes the importer entry for packages/@n8n/scan-community-package even though
that workspace package and its dependencies still exist, leaving the lockfile inconsistent with the
workspace manifests.
Code

pnpm-lock.yaml[L1255-1272]

-  packages/@n8n/scan-community-package:
-    dependencies:
-      axios:
-        specifier: 'catalog:'
-        version: 1.8.3
-      eslint:
-        specifier: 'catalog:'
-        version: 9.29.0(jiti@1.21.7)
-      fast-glob:
-        specifier: 'catalog:'
-        version: 3.2.12
-      semver:
-        specifier: ^7.5.4
-        version: 7.7.2
-      tmp:
-        specifier: 0.2.4
-        version: 0.2.4
-
Evidence
The lockfile importer is removed in this PR, but pnpm-workspace.yaml still includes
packages/@n8n/* and packages/@n8n/scan-community-package/package.json still declares the package
and dependencies.

pnpm-lock.yaml[1255-1272]
pnpm-workspace.yaml[1-4]
packages/@n8n/scan-community-package/package.json[1-16]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `packages/@n8n/scan-community-package` importer stanza was removed from `pnpm-lock.yaml` while the package still exists in the workspace, making the lockfile stale/incomplete.
### Issue Context
`pnpm-workspace.yaml` includes `packages/@n8n/*`, and `packages/@n8n/scan-community-package/package.json` still declares dependencies.
### Fix Focus Areas
- pnpm-lock.yaml[1255-1272]
- pnpm-workspace.yaml[1-4]
- packages/@n8n/scan-community-package/package.json[1-16]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Bad worker URL 🐞 Bug ≡ Correctness
Description
The run-data worker is instantiated with a URL that resolves to a non-existent path
(./run-data/worker.ts relative to run-data/instance.ts), so Worker creation will fail at
runtime.
Code

packages/frontend/editor-ui/src/workers/run-data/instance.ts[R4-6]

+const worker = new Worker(new URL('./run-data/worker.ts', import.meta.url), {
+	type: 'module',
+});
Evidence
instance.ts is already inside src/workers/run-data/, so adding ./run-data/ duplicates the
directory and points to a file that does not exist. The repo’s existing worker instantiation pattern
uses a relative path that does not re-include the containing directory name.

packages/frontend/editor-ui/src/workers/run-data/instance.ts[4-6]
packages/frontend/editor-ui/src/workers/run-data/worker.ts[1-3]
packages/frontend/editor-ui/src/plugins/codemirror/typescript/client/useTypescript.ts[41-44]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The run-data worker URL is constructed as `./run-data/worker.ts` from within `src/workers/run-data/instance.ts`, which resolves to `src/workers/run-data/run-data/worker.ts` and fails to load.
### Issue Context
`instance.ts` and `worker.ts` are in the same directory.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/instance.ts[4-6]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Worker not Comlink-exposed 🐞 Bug ≡ Correctness
Description
The run-data worker exports actions but never calls Comlink.expose(), so Comlink.wrap() in the
main thread will not be able to invoke initialize().
Code

packages/frontend/editor-ui/src/workers/run-data/worker.ts[R13-22]

+export const actions = {
+	async initialize() {
+		const { promiser, dbId } = await useDatabase(databaseConfig);
+
+		state.promiser = promiser;
+		state.dbId = dbId;
+	},
+};
+
+export type RunDataWorker = typeof actions;
Evidence
The instance uses Comlink.wrap(worker) which requires the worker side to call
Comlink.expose(...). The codebase’s existing Comlink worker does this explicitly, but the new
run-data worker does not.

packages/frontend/editor-ui/src/workers/run-data/instance.ts[1-8]
packages/frontend/editor-ui/src/workers/run-data/worker.ts[13-22]
packages/frontend/editor-ui/src/plugins/codemirror/typescript/worker/typescript.worker.ts[224-224]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The run-data worker is wrapped via Comlink on the main thread but never exposes any API via `Comlink.expose()`, so RPC calls will fail.
### Issue Context
There is an established Comlink pattern in the repo (`typescript.worker.ts`) that calls `Comlink.expose(...)`.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/worker.ts[1-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (3)
4. Wrong JSON check column 🐞 Bug ≡ Correctness
Description
The executions.workflow column CHECK constraint validates json_valid(data) instead of
json_valid(workflow), allowing invalid JSON to be stored in workflow.
Code

packages/frontend/editor-ui/src/workers/run-data/db.ts[R11-15]

+          workflow_id INTEGER NOT NULL,
+          data TEXT CHECK (json_valid(data)) NOT NULL,
+          workflow TEXT CHECK (json_valid(data)) NOT NULL,
+          created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+        );
Evidence
The schema’s workflow column constraint references the data column, making it ineffective at
validating the workflow column contents.

packages/frontend/editor-ui/src/workers/run-data/db.ts[9-15]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`workflow` column validation is incorrectly checking `data` instead of `workflow`, so invalid JSON can be persisted.
### Issue Context
Both `data` and `workflow` are intended to be JSON strings.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/db.ts[11-15]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Unchecked promiser error results 🐞 Bug ≡ Correctness
Description
useDatabase() does not validate config-get or exec responses for type: 'error' and
force-casts dbId to string even though it can be undefined, so initialization can proceed with
invalid state.
Code

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[R28-42]

+	const cfg = await promiser('config-get', {});
+	const openResponse = await promiser('open', {
+		filename: config.filename,
+	});
+
+	if (openResponse.type === 'error') {
+		throw new Error(openResponse.result.message);
+	}
+
+	dbId = openResponse.result.dbId as string;
+
+	await promiser('exec', {
+		dbId,
+		sql: config.tables.executions.schema,
+	});
Evidence
The promiser return type is explicitly a success-or-error union, but useDatabase() only checks for
errors on open. It also casts dbId from string | undefined to string without validation, and
ignores whether exec returned an error response.

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[28-42]
packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[14-16]
packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[84-91]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`useDatabase()` treats promiser calls as always-successful (except `open`) even though the declared response type is a success/error union, and it force-casts possibly-undefined `dbId`.
### Issue Context
The type definition for the sqlite-wasm promiser explicitly models error responses (`type: 'error'`).
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[28-42]
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[14-16]
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[84-91]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Wrong Worker type definition 🐞 Bug ≡ Correctness
Description
The ambient @sqlite.org/sqlite-wasm typings import Worker from node:worker_threads, which is
incompatible with browser Web Workers and will prevent correctly typing a DOM Worker for
sqlite3Worker1Promiser() configuration.
Code

packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[R1-12]

+import type { Worker } from 'node:worker_threads';
+
+declare module '@sqlite.org/sqlite-wasm' {
+	type OnreadyFunction = () => void;
+
+	export type Sqlite3Worker1PromiserConfig = {
+		onready?: OnreadyFunction;
+		worker?: Worker | (() => Worker);
+		generateMessageId?: (messageObject: unknown) => string;
+		debug?: (...args: any[]) => void;
+		onunhandled?: (event: MessageEvent) => void;
+	};
Evidence
Editor-ui is compiled with DOM libs, and the codebase uses browser Workers. The sqlite-wasm ambient
declaration instead types the worker option using Node’s worker_threads Worker, which is not
assignable from a DOM Worker and may also require Node module type resolution in a frontend build.

packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[1-12]
packages/@n8n/typescript-config/tsconfig.frontend.json[9-11]
packages/frontend/editor-ui/src/plugins/codemirror/typescript/client/useTypescript.ts[42-44]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The sqlite-wasm ambient typings are using Node's `worker_threads` Worker type, which is incompatible with the DOM Worker type used in the editor UI.
### Issue Context
editor-ui compiles with DOM libs and uses browser workers.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[1-12]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
7. Hardcoded executions table init 🐞 Bug ⚙ Maintainability
Description
useDatabase() always runs config.tables.executions.schema instead of initializing all configured
tables, so adding any other table to DatabaseConfig.tables will be ignored and omitting
executions will crash. This contradicts the generic Record config shape.
Code

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[R39-42]

+	await promiser('exec', {
+		dbId,
+		sql: config.tables.executions.schema,
+	});
Evidence
DatabaseConfig.tables is a generic record, but useDatabase() assumes a specific executions key
and never iterates through the configured tables.

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[9-12]
packages/frontend/editor-ui/src/workers/database/useDatabase.ts[39-42]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Database initialization is hardcoded to the `executions` table despite `tables` being a generic record.
### Fix
Iterate over `Object.values(config.tables)` (or entries) and execute each table's `schema` with `promiser('exec', ...)`.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[9-12]
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[39-42]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider Grey Divider
Results up to commit 2a9e0e7


🐞 Bugs (7) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX Issues (0)

Grey Divider
Action required
1. Workspace importer removed 🐞 Bug ☼ Reliability ⭐ New
Description
pnpm-lock.yaml deletes the importer entry for packages/@n8n/scan-community-package even though
that workspace package and its dependencies still exist, leaving the lockfile inconsistent with the
workspace manifests.
Code

pnpm-lock.yaml[L1255-1272]

-  packages/@n8n/scan-community-package:
-    dependencies:
-      axios:
-        specifier: 'catalog:'
-        version: 1.8.3
-      eslint:
-        specifier: 'catalog:'
-        version: 9.29.0(jiti@1.21.7)
-      fast-glob:
-        specifier: 'catalog:'
-        version: 3.2.12
-      semver:
-        specifier: ^7.5.4
-        version: 7.7.2
-      tmp:
-        specifier: 0.2.4
-        version: 0.2.4
-
Evidence
The lockfile importer is removed in this PR, but pnpm-workspace.yaml still includes
packages/@n8n/* and packages/@n8n/scan-community-package/package.json still declares the package
and dependencies.

pnpm-lock.yaml[1255-1272]
pnpm-workspace.yaml[1-4]
packages/@n8n/scan-community-package/package.json[1-16]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The `packages/@n8n/scan-community-package` importer stanza was removed from `pnpm-lock.yaml` while the package still exists in the workspace, making the lockfile stale/incomplete.

### Issue Context
`pnpm-workspace.yaml` includes `packages/@n8n/*`, and `packages/@n8n/scan-community-package/package.json` still declares dependencies.

### Fix Focus Areas
- pnpm-lock.yaml[1255-1272]
- pnpm-workspace.yaml[1-4]
- packages/@n8n/scan-community-package/package.json[1-16]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Bad worker URL 🐞 Bug ≡ Correctness
Description
The run-data worker is instantiated with a URL that resolves to a non-existent path
(./run-data/worker.ts relative to run-data/instance.ts), so Worker creation will fail at
runtime.
Code

packages/frontend/editor-ui/src/workers/run-data/instance.ts[R4-6]

+const worker = new Worker(new URL('./run-data/worker.ts', import.meta.url), {
+	type: 'module',
+});
Evidence
instance.ts is already inside src/workers/run-data/, so adding ./run-data/ duplicates the
directory and points to a file that does not exist. The repo’s existing worker instantiation pattern
uses a relative path that does not re-include the containing directory name.

packages/frontend/editor-ui/src/workers/run-data/instance.ts[4-6]
packages/frontend/editor-ui/src/workers/run-data/worker.ts[1-3]
packages/frontend/editor-ui/src/plugins/codemirror/typescript/client/useTypescript.ts[41-44]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The run-data worker URL is constructed as `./run-data/worker.ts` from within `src/workers/run-data/instance.ts`, which resolves to `src/workers/run-data/run-data/worker.ts` and fails to load.
### Issue Context
`instance.ts` and `worker.ts` are in the same directory.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/instance.ts[4-6]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Worker not Comlink-exposed 🐞 Bug ≡ Correctness
Description
The run-data worker exports actions but never calls Comlink.expose(), so Comlink.wrap() in the
main thread will not be able to invoke initialize().
Code

packages/frontend/editor-ui/src/workers/run-data/worker.ts[R13-22]

+export const actions = {
+	async initialize() {
+		const { promiser, dbId } = await useDatabase(databaseConfig);
+
+		state.promiser = promiser;
+		state.dbId = dbId;
+	},
+};
+
+export type RunDataWorker = typeof actions;
Evidence
The instance uses Comlink.wrap(worker) which requires the worker side to call
Comlink.expose(...). The codebase’s existing Comlink worker does this explicitly, but the new
run-data worker does not.

packages/frontend/editor-ui/src/workers/run-data/instance.ts[1-8]
packages/frontend/editor-ui/src/workers/run-data/worker.ts[13-22]
packages/frontend/editor-ui/src/plugins/codemirror/typescript/worker/typescript.worker.ts[224-224]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The run-data worker is wrapped via Comlink on the main thread but never exposes any API via `Comlink.expose()`, so RPC calls will fail.
### Issue Context
There is an established Comlink pattern in the repo (`typescript.worker.ts`) that calls `Comlink.expose(...)`.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/worker.ts[1-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (3)
4. Wrong JSON check column 🐞 Bug ≡ Correctness
Description
The executions.workflow column CHECK constraint validates json_valid(data) instead of
json_valid(workflow), allowing invalid JSON to be stored in workflow.
Code

packages/frontend/editor-ui/src/workers/run-data/db.ts[R11-15]

+          workflow_id INTEGER NOT NULL,
+          data TEXT CHECK (json_valid(data)) NOT NULL,
+          workflow TEXT CHECK (json_valid(data)) NOT NULL,
+          created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+        );
Evidence
The schema’s workflow column constraint references the data column, making it ineffective at
validating the workflow column contents.

packages/frontend/editor-ui/src/workers/run-data/db.ts[9-15]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`workflow` column validation is incorrectly checking `data` instead of `workflow`, so invalid JSON can be persisted.
### Issue Context
Both `data` and `workflow` are intended to be JSON strings.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/db.ts[11-15]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Unchecked promiser error results 🐞 Bug ≡ Correctness
Description
useDatabase() does not validate config-get or exec responses for type: 'error' and
force-casts dbId to string even though it can be undefined, so initialization can proceed with
invalid state.
Code

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[R28-42]

+	const cfg = await promiser('config-get', {});
+	const openResponse = await promiser('open', {
+		filename: config.filename,
+	});
+
+	if (openResponse.type === 'error') {
+		throw new Error(openResponse.result.message);
+	}
+
+	dbId = openResponse.result.dbId as string;
+
+	await promiser('exec', {
+		dbId,
+		sql: config.tables.executions.schema,
+	});
Evidence
The promiser return type is explicitly a success-or-error union, but useDatabase() only checks for
errors on open. It also casts dbId from string | undefined to string without validation, and
ignores whether exec returned an error response.

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[28-42]
packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[14-16]
packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[84-91]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`useDatabase()` treats promiser calls as always-successful (except `open`) even though the declared response type is a success/error union, and it force-casts possibly-undefined `dbId`.
### Issue Context
The type definition for the sqlite-wasm promiser explicitly models error responses (`type: 'error'`).
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[28-42]
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[14-16]
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[84-91]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Wrong Worker type definition 🐞 Bug ≡ Correctness
Description
The ambient @sqlite.org/sqlite-wasm typings import Worker from node:worker_threads, which is
incompatible with browser Web Workers and will prevent correctly typing a DOM Worker for
sqlite3Worker1Promiser() configuration.
Code

packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[R1-12]

+import type { Worker } from 'node:worker_threads';
+
+declare module '@sqlite.org/sqlite-wasm' {
+	type OnreadyFunction = () => void;
+
+	export type Sqlite3Worker1PromiserConfig = {
+		onready?: OnreadyFunction;
+		worker?: Worker | (() => Worker);
+		generateMessageId?: (messageObject: unknown) => string;
+		debug?: (...args: any[]) => void;
+		onunhandled?: (event: MessageEvent) => void;
+	};
Evidence
Editor-ui is compiled with DOM libs, and the codebase uses browser Workers. The sqlite-wasm ambient
declaration instead types the worker option using Node’s worker_threads Worker, which is not
assignable from a DOM Worker and may also require Node module type resolution in a frontend build.

packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[1-12]
packages/@n8n/typescript-config/tsconfig.frontend.json[9-11]
packages/frontend/editor-ui/src/plugins/codemirror/typescript/client/useTypescript.ts[42-44]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The sqlite-wasm ambient typings are using Node's `worker_threads` Worker type, which is incompatible with the DOM Worker type used in the editor UI.
### Issue Context
editor-ui compiles with DOM libs and uses browser workers.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[1-12]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
7. Hardcoded executions table init 🐞 Bug ⚙ Maintainability
Description
useDatabase() always runs config.tables.executions.schema instead of initializing all configured
tables, so adding any other table to DatabaseConfig.tables will be ignored and omitting
executions will crash. This contradicts the generic Record config shape.
Code

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[R39-42]

+	await promiser('exec', {
+		dbId,
+		sql: config.tables.executions.schema,
+	});
Evidence
DatabaseConfig.tables is a generic record, but useDatabase() assumes a specific executions key
and never iterates through the configured tables.

packages/frontend/editor-ui/src/workers/database/useDatabase.ts[9-12]
packages/frontend/editor-ui/src/workers/database/useDatabase.ts[39-42]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Database initialization is hardcoded to the `executions` table despite `tables` being a generic record.
### Fix
Iterate over `Object.values(config.tables)` (or entries) and execute each table's `schema` with `promiser('exec', ...)`.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[9-12]
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[39-42]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider Grey Divider
Results up to commit 2a9e0e7


🐞 Bugs (6) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider
Action required
1. Bad worker URL 🐞 Bug ≡ Correctness
Description
The run-data worker is instantiated with a URL that resolves to a non-existent path
(./run-data/worker.ts relative to run-data/instance.ts), so Worker creation will fail at
runtime.
Code

packages/frontend/editor-ui/src/workers/run-data/instance.ts[R4-6]

+const worker = new Worker(new URL('./run-data/worker.ts', import.meta.url), {
+	type: 'module',
+});
Evidence
instance.ts is already inside src/workers/run-data/, so adding ./run-data/ duplicates the
directory and points to a file that does not exist. The repo’s existing worker instantiation pattern
uses a relative path that does not re-include the containing directory name.

packages/frontend/editor-ui/src/workers/run-data/instance.ts[4-6]
packages/frontend/editor-ui/src/workers/run-data/worker.ts[1-3]
packages/frontend/editor-ui/src/plugins/codemirror/typescript/client/useTypescript.ts[41-44]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The run-data worker URL is constructed as `./run-data/worker.ts` from within `src/workers/run-data/instance.ts`, which resolves to `src/workers/run-data/run-data/worker.ts` and fails to load.
### Issue Context
`instance.ts` and `worker.ts` are in the same directory.
### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/instance.ts[4-6]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Worker not Comlink-exposed 🐞 Bug ≡ Correctness
Description
The run-data worker exports actions but never calls Comlink.expose(), so Comlink.wrap() in the
main thread will not be able to invoke initialize().
Code

packages/frontend/editor-ui/src/workers/run-data/worker.ts[R13-22]

+export const actions = {
+	async initialize() {
+		const { promiser, dbId } = await useDatabase(databaseConfig);
+
+		state.promiser = promiser;
+		state.dbId = dbId;
+	},
+};
+
+export type RunDataWorker = typeof actions;
Evidence
The instance uses Comlink.wrap(worker) which requires the worker side to call
Comlink.expose(...). The codebase’s existing Comlink worker does this explicitly, but the new
run-data worker does not.

packages/frontend/editor-ui/src/workers/run-data/instance.ts[1-8]
packages/frontend/editor-ui/src/workers/run-data/worker.ts[13-22]
[packages/frontend/editor-ui/src/plugins/codemirror/typescript/worker/typescript.worker.ts[224-224]](https://github.com/qodo-benchmark/n8n/blob/2a9e0e782b4c6d2d456d5eb23ce4897c64f928d4/packages/frontend/editor-ui/src/plugins/codemirror/typescript/worker/typescript.worke...

Comment on lines +4 to +6
const worker = new Worker(new URL('./run-data/worker.ts', import.meta.url), {
type: 'module',
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Worker url resolves wrong 🐞 Bug ✓ Correctness

AYT runDataWorker constructs a Worker URL that resolves to a non-existent path
(run-data/run-data/worker.ts), so the worker will fail to load at runtime.
Agent Prompt
### Issue description
The run-data worker is instantiated with a URL that includes an extra `run-data/` path segment, which makes the resolved path incorrect and prevents the worker from loading.

### Issue Context
`instance.ts` and `worker.ts` are in the same folder (`src/workers/run-data/`). The current URL resolves relative to `instance.ts`.

### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/instance.ts[4-6]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +13 to +22
export const actions = {
async initialize() {
const { promiser, dbId } = await useDatabase(databaseConfig);

state.promiser = promiser;
state.dbId = dbId;
},
};

export type RunDataWorker = typeof actions;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Worker methods not exposed 🐞 Bug ✓ Correctness

AYT the run-data worker never calls Comlink.expose(actions), so Comlink.wrap() clients cannot
invoke initialize() and the worker will be unusable.
Agent Prompt
### Issue description
The run-data worker defines an `actions` API but does not expose it using Comlink, so the main thread cannot call `initialize()` via `Comlink.wrap()`.

### Issue Context
The repo’s existing Comlink worker (`typescript.worker.ts`) exposes its API using `Comlink.expose(...)`.

### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/worker.ts[1-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +12 to +14
data TEXT CHECK (json_valid(data)) NOT NULL,
workflow TEXT CHECK (json_valid(data)) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

3. Workflow json check wrong 🐞 Bug ✓ Correctness

AYT the workflow column CHECK constraint validates json_valid(data) instead of
json_valid(workflow), so invalid workflow JSON will not be rejected by the schema.
Agent Prompt
### Issue description
The `workflow` column’s CHECK constraint validates the wrong column (`data`), so workflow JSON is not actually validated.

### Issue Context
This is in the schema used during initialization via `useDatabase()`.

### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/db.ts[9-15]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +28 to +42
const cfg = await promiser('config-get', {});
const openResponse = await promiser('open', {
filename: config.filename,
});

if (openResponse.type === 'error') {
throw new Error(openResponse.result.message);
}

dbId = openResponse.result.dbId as string;

await promiser('exec', {
dbId,
sql: config.tables.executions.schema,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

4. Sqlite errors ignored 🐞 Bug ⛯ Reliability

AYT useDatabase does not validate config-get or exec responses for type === 'error', so
initialization can return successfully even if the worker reports an error (including schema
creation failure).
Agent Prompt
### Issue description
`useDatabase()` ignores possible `'error'` responses from `config-get` and `exec`, which can allow initialization to proceed with an unusable DB.

### Issue Context
The local `PromiserResponse` type is a union of success and error; callers must branch on `type`.

### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[28-42]
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[71-86]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +37 to +41
dbId = openResponse.result.dbId as string;

await promiser('exec', {
dbId,
sql: config.tables.executions.schema,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

5. Dbid cast hides undefined 🐞 Bug ✓ Correctness

AYT useDatabase casts openResponse.result.dbId to string even though the declared type allows
undefined, which can propagate an invalid dbId into later calls.
Agent Prompt
### Issue description
`dbId` is cast to `string` even though it may be `undefined` per the declared types, which can allow later SQL operations to run without a valid DB id.

### Issue Context
`DbId` is declared as `string | undefined` in `sqlite-wasm.d.ts` and used by `open` responses.

### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[33-42]
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[14-15]
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[37-42]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@tomerqodo

tomerqodo commented Mar 17, 2026

Copy link
Copy Markdown
Author

Persistent review updated to latest commit 2a9e0e7

Comment on lines +4 to +6
const worker = new Worker(new URL('./run-data/worker.ts', import.meta.url), {
type: 'module',
});

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Action required

1. Bad worker url 🐞 Bug ✓ Correctness

The run-data worker is instantiated with a URL that resolves to a non-existent path
(./run-data/worker.ts relative to run-data/instance.ts), so Worker creation will fail at
runtime.
Agent Prompt
### Issue description
The run-data worker URL is constructed as `./run-data/worker.ts` from within `src/workers/run-data/instance.ts`, which resolves to `src/workers/run-data/run-data/worker.ts` and fails to load.

### Issue Context
`instance.ts` and `worker.ts` are in the same directory.

### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/instance.ts[4-6]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +13 to +22
export const actions = {
async initialize() {
const { promiser, dbId } = await useDatabase(databaseConfig);

state.promiser = promiser;
state.dbId = dbId;
},
};

export type RunDataWorker = typeof actions;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Action required

2. Worker not comlink-exposed 🐞 Bug ✓ Correctness

The run-data worker exports actions but never calls Comlink.expose(), so Comlink.wrap() in the
main thread will not be able to invoke initialize().
Agent Prompt
### Issue description
The run-data worker is wrapped via Comlink on the main thread but never exposes any API via `Comlink.expose()`, so RPC calls will fail.

### Issue Context
There is an established Comlink pattern in the repo (`typescript.worker.ts`) that calls `Comlink.expose(...)`.

### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/worker.ts[1-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +11 to +15
workflow_id INTEGER NOT NULL,
data TEXT CHECK (json_valid(data)) NOT NULL,
workflow TEXT CHECK (json_valid(data)) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Action required

3. Wrong json check column 🐞 Bug ✓ Correctness

The executions.workflow column CHECK constraint validates json_valid(data) instead of
json_valid(workflow), allowing invalid JSON to be stored in workflow.
Agent Prompt
### Issue description
`workflow` column validation is incorrectly checking `data` instead of `workflow`, so invalid JSON can be persisted.

### Issue Context
Both `data` and `workflow` are intended to be JSON strings.

### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/run-data/db.ts[11-15]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +28 to +42
const cfg = await promiser('config-get', {});
const openResponse = await promiser('open', {
filename: config.filename,
});

if (openResponse.type === 'error') {
throw new Error(openResponse.result.message);
}

dbId = openResponse.result.dbId as string;

await promiser('exec', {
dbId,
sql: config.tables.executions.schema,
});

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Action required

4. Unchecked promiser error results 🐞 Bug ⛯ Reliability

useDatabase() does not validate config-get or exec responses for type: 'error' and
force-casts dbId to string even though it can be undefined, so initialization can proceed with
invalid state.
Agent Prompt
### Issue description
`useDatabase()` treats promiser calls as always-successful (except `open`) even though the declared response type is a success/error union, and it force-casts possibly-undefined `dbId`.

### Issue Context
The type definition for the sqlite-wasm promiser explicitly models error responses (`type: 'error'`).

### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[28-42]
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[14-16]
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[84-91]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +1 to +12
import type { Worker } from 'node:worker_threads';

declare module '@sqlite.org/sqlite-wasm' {
type OnreadyFunction = () => void;

export type Sqlite3Worker1PromiserConfig = {
onready?: OnreadyFunction;
worker?: Worker | (() => Worker);
generateMessageId?: (messageObject: unknown) => string;
debug?: (...args: any[]) => void;
onunhandled?: (event: MessageEvent) => void;
};

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Action required

5. Wrong worker type definition 🐞 Bug ✓ Correctness

The ambient @sqlite.org/sqlite-wasm typings import Worker from node:worker_threads, which is
incompatible with browser Web Workers and will prevent correctly typing a DOM Worker for
sqlite3Worker1Promiser() configuration.
Agent Prompt
### Issue description
The sqlite-wasm ambient typings are using Node's `worker_threads` Worker type, which is incompatible with the DOM Worker type used in the editor UI.

### Issue Context
editor-ui compiles with DOM libs and uses browser workers.

### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/sqlite-wasm.d.ts[1-12]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@tomerqodo

Copy link
Copy Markdown
Author

Code Review by Qodo

Grey Divider

Looking for bugs?

Check back in a few minutes. An AI review agent is analyzing this pull request.

Grey Divider

Qodo Logo

@tomerqodo

tomerqodo commented Mar 23, 2026

Copy link
Copy Markdown
Author

Persistent review updated to latest commit 2a9e0e7

@tomerqodo

Copy link
Copy Markdown
Author

Code Review by Qodo

Grey Divider

Looking for bugs?

Check back in a few minutes. An AI review agent is analyzing this pull request.

Grey Divider

Qodo Logo

@tomerqodo

Copy link
Copy Markdown
Author

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@tomerqodo

tomerqodo commented Mar 31, 2026

Copy link
Copy Markdown
Author

Persistent review updated to latest commit 2a9e0e7

Comment on lines +39 to +42
await promiser('exec', {
dbId,
sql: config.tables.executions.schema,
});

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Remediation recommended

1. Hardcoded executions table init 🐞 Bug ⚙ Maintainability

useDatabase() always runs config.tables.executions.schema instead of initializing all configured
tables, so adding any other table to DatabaseConfig.tables will be ignored and omitting
executions will crash. This contradicts the generic Record<string, DatabaseTable> config shape.
Agent Prompt
### Issue description
Database initialization is hardcoded to the `executions` table despite `tables` being a generic record.

### Fix
Iterate over `Object.values(config.tables)` (or entries) and execute each table's `schema` with `promiser('exec', ...)`.

### Fix Focus Areas
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[9-12]
- packages/frontend/editor-ui/src/workers/database/useDatabase.ts[39-42]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@tomerqodo

Copy link
Copy Markdown
Author

Code Review by Qodo

Grey Divider

Looking for bugs?

Check back in a few minutes. An AI review agent is analyzing this pull request.

Grey Divider

Qodo Logo

4 similar comments
@tomerqodo

Copy link
Copy Markdown
Author

Code Review by Qodo

Grey Divider

Looking for bugs?

Check back in a few minutes. An AI review agent is analyzing this pull request.

Grey Divider

Qodo Logo

@tomerqodo

Copy link
Copy Markdown
Author

Code Review by Qodo

Grey Divider

Looking for bugs?

Check back in a few minutes. An AI review agent is analyzing this pull request.

Grey Divider

Qodo Logo

@tomerqodo

Copy link
Copy Markdown
Author

Code Review by Qodo

Grey Divider

Looking for bugs?

Check back in a few minutes. An AI review agent is analyzing this pull request.

Grey Divider

Qodo Logo

@tomerqodo

Copy link
Copy Markdown
Author

Code Review by Qodo

Grey Divider

Looking for bugs?

Check back in a few minutes. An AI review agent is analyzing this pull request.

Grey Divider

Qodo Logo

@tomerqodo

tomerqodo commented Apr 5, 2026

Copy link
Copy Markdown
Author

Persistent review updated to latest commit 2a9e0e7

Comment thread pnpm-lock.yaml
specifier: workspace:*
version: link:../typescript-config

packages/@n8n/scan-community-package:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Action required

1. Workspace importer removed 🐞 Bug ☼ Reliability

pnpm-lock.yaml deletes the importer entry for packages/@n8n/scan-community-package even though
that workspace package and its dependencies still exist, leaving the lockfile inconsistent with the
workspace manifests.
Agent Prompt
### Issue description
The `packages/@n8n/scan-community-package` importer stanza was removed from `pnpm-lock.yaml` while the package still exists in the workspace, making the lockfile stale/incomplete.

### Issue Context
`pnpm-workspace.yaml` includes `packages/@n8n/*`, and `packages/@n8n/scan-community-package/package.json` still declares dependencies.

### Fix Focus Areas
- pnpm-lock.yaml[1255-1272]
- pnpm-workspace.yaml[1-4]
- packages/@n8n/scan-community-package/package.json[1-16]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@tomerqodo

tomerqodo commented Apr 5, 2026

Copy link
Copy Markdown
Author

Persistent review updated to latest commit 2a9e0e7

1 similar comment
@tomerqodo

tomerqodo commented Apr 5, 2026

Copy link
Copy Markdown
Author

Persistent review updated to latest commit 2a9e0e7

@tomerqodo

Copy link
Copy Markdown
Author

Code Review by Qodo

Grey Divider

Looking for bugs?

Check back in a few minutes. An AI review agent is analyzing this pull request.

Grey Divider

Qodo Logo

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants