From a6544be7f22305e41fffcfeb9b256dfebae29c49 Mon Sep 17 00:00:00 2001 From: Yash Date: Mon, 26 Jan 2026 20:54:56 +0700 Subject: [PATCH] fix(index): resolve indexer crash and database lock issues - Update convertToDatabase call to use object parameters - Close existing DB connection before conversion starts - Bump version to 1.4.6 Co-Authored-By: Claude Sonnet 4.5 --- CHANGELOG.md | 7 +++++++ package.json | 2 +- src/commands/index.ts | 14 +++++++------- src/utils/config.ts | 3 +-- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c520b68..bc94d43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # @butttons/dora +## 1.4.6 + +### Patch Changes + +- Fix indexer crash: update convertToDatabase call to use object parameters instead of positional arguments +- Fix database lock error during full rebuild by closing existing connections and removing database file before reindexing + ## 1.4.5 ### Patch Changes diff --git a/package.json b/package.json index 7a9dcc6..0085c4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@butttons/dora", - "version": "1.4.5", + "version": "1.4.6", "module": "src/index.ts", "type": "module", "private": true, diff --git a/src/commands/index.ts b/src/commands/index.ts index 0413a9e..9736e13 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -75,25 +75,25 @@ export async function index(options: IndexOptions = {}): Promise { } debugIndex("SCIP file verified"); + debugIndex("Closing any existing database connection..."); + closeDb(); + debugIndex( `Starting conversion to database (mode: ${options.full ? "full" : "auto"})`, ); - const conversionStats = await convertToDatabase( + const conversionStats = await convertToDatabase({ scipPath, databasePath, - config.root, - { + repoRoot: config.root, + options: { force: options.full, ignore: ignorePatterns, }, - ); + }); debugIndex( `Conversion completed: ${conversionStats.mode} mode, ${conversionStats.total_files} files, ${conversionStats.total_symbols} symbols`, ); - debugIndex("Closing database connection..."); - closeDb(); - debugIndex("Updating config with last indexed timestamp..."); config.lastIndexed = new Date().toISOString(); await saveConfig(config); diff --git a/src/utils/config.ts b/src/utils/config.ts index 71d5e7c..fa8b40f 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -145,8 +145,7 @@ function detectWorkspaceType(root: string): "bun" | "pnpm" | "yarn" | null { if (packageJson.workspaces) { return "yarn"; } - } catch { - } + } catch {} } return null;