{"record":{"id":"41348b946c2bed2c","repo":"diegosouzapw/OmniRoute","slug":"database-optimization-settings-did-not-take-effect","errorCode":null,"errorMessage":"database optimization settings did not take effect (auto_vacuum expected ${targetAutoVacuum}, got ${newAutoVacuum}; page_size expected ${targetPageSize}, got ${newPageSize})","messagePattern":"database optimization settings did not take effect \\(auto_vacuum expected (.+?), got (.+?); page_size expected (.+?), got (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/db/optimizationSettings.ts","lineNumber":216,"sourceCode":"    if (shouldRestoreWal) db.pragma(\"journal_mode = DELETE\");\n    db.pragma(`auto_vacuum = ${targetAutoVacuum}`);\n    db.pragma(`page_size = ${targetPageSize}`);\n    db.exec(\"VACUUM\");\n  } finally {\n    if (shouldRestoreWal) {\n      try {\n        db.pragma(\"journal_mode = WAL\");\n      } catch (error) {\n        const message = error instanceof Error ? error.message : String(error);\n        console.warn(`[DB] Failed to restore WAL mode after optimization settings: ${message}`);\n      }\n    }\n  }\n\n  const newAutoVacuum = db.pragma(\"auto_vacuum\", { simple: true }) as number;\n  const newPageSize = db.pragma(\"page_size\", { simple: true }) as number;\n  if (newAutoVacuum !== targetAutoVacuum || newPageSize !== targetPageSize) {\n    throw new Error(\n      `database optimization settings did not take effect ` +\n        `(auto_vacuum expected ${targetAutoVacuum}, got ${newAutoVacuum}; ` +\n        `page_size expected ${targetPageSize}, got ${newPageSize})`\n    );\n  }\n}\n\nexport function applyDatabaseOptimizationSettingsForDb(\n  db: SqliteDatabase,\n  settings: DatabaseOptimizationSettings,\n  options: { applyPersistent: boolean }\n): void {\n  if (options.applyPersistent) applyPersistentOptimizationPragmas(db, settings);\n  setCacheSizeForDb(\n    db,\n    normalizeStoredCacheSizeKb(settings.cacheSize, DEFAULT_DATABASE_SETTINGS.optimization.cacheSize)\n  );\n}","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/db/optimizationSettings.ts#L198-L234","documentation":"Error \"database optimization settings did not take effect (auto_vacuum expected ${targetAutoVacuum}, got ${newAutoVacuum}; page_size expected ${targetPageSize}, got ${newPageSize})\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/db/optimizationSettings.ts:216 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}