diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index baeab1a0b9..9c3af687cf 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -1515,15 +1515,37 @@ Zotero.Schema = new function(){ } // TEMP: DB diagnostics + let badDB = false; let exists = yield Zotero.DB.tableExists('transactionSets'); url += "&ts=" + (exists ? "1" : "0"); if (exists) { Zotero.logError("DB table 'transactionSets' still exists"); + badDB = true; } exists = yield Zotero.DB.tableExists('dbDebug1'); url += "&db1=" + (exists ? "1" : "0"); if (!exists) { Zotero.logError("DB table 'dbDebug1' does not exist"); + badDB = true; + } + if (badDB) { + let cloudDir = Zotero.File.isCloudStorageFolder(Zotero.DataDirectory.dir); + url += "&cd=" + (cloudDir ? "1" : "0"); + + if (!this._debugDBIntegrityChecked) { + try { + let dbPath = Zotero.DataDirectory.getDatabase(); + let dbInfo = yield OS.File.stat(dbPath); + if (dbInfo.size < 500000000) { + let ok = yield Zotero.DB.quickCheck(); + url += "&qc=" + (ok ? "1" : "0"); + this._debugDBIntegrityChecked = true; + } + } + catch (e) { + Zotero.logError(e); + } + } } // Send list of installed styles