@vue-skuilder/db 0.1.11-12 → 0.1.11-14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.js +33 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +33 -2
- package/dist/core/index.mjs.map +1 -1
- package/dist/impl/couch/index.js +33 -2
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +33 -2
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.js +33 -2
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +33 -2
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.js +33 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/impl/common/BaseUserDB.ts +35 -2
package/dist/core/index.js
CHANGED
|
@@ -2094,8 +2094,18 @@ Currently logged-in as ${this._username}.`
|
|
|
2094
2094
|
}
|
|
2095
2095
|
this.setDBandQ();
|
|
2096
2096
|
this.syncStrategy.startSync(this.localDB, this.remoteDB);
|
|
2097
|
-
|
|
2098
|
-
|
|
2097
|
+
this.applyDesignDocs().catch((error) => {
|
|
2098
|
+
log3(`Error in applyDesignDocs background task: ${error}`);
|
|
2099
|
+
if (error && typeof error === "object") {
|
|
2100
|
+
log3(`Full error details in applyDesignDocs: ${JSON.stringify(error)}`);
|
|
2101
|
+
}
|
|
2102
|
+
});
|
|
2103
|
+
this.deduplicateReviews().catch((error) => {
|
|
2104
|
+
log3(`Error in deduplicateReviews background task: ${error}`);
|
|
2105
|
+
if (error && typeof error === "object") {
|
|
2106
|
+
log3(`Full error details in background task: ${JSON.stringify(error)}`);
|
|
2107
|
+
}
|
|
2108
|
+
});
|
|
2099
2109
|
_BaseUser._initialized = true;
|
|
2100
2110
|
}
|
|
2101
2111
|
static designDocs = [
|
|
@@ -2113,10 +2123,15 @@ Currently logged-in as ${this._username}.`
|
|
|
2113
2123
|
}
|
|
2114
2124
|
];
|
|
2115
2125
|
async applyDesignDocs() {
|
|
2126
|
+
log3(`Starting applyDesignDocs for user: ${this._username}`);
|
|
2127
|
+
log3(`Remote DB name: ${this.remoteDB.name || "unknown"}`);
|
|
2116
2128
|
if (this._username === "admin") {
|
|
2129
|
+
log3("Skipping design docs for admin user");
|
|
2117
2130
|
return;
|
|
2118
2131
|
}
|
|
2132
|
+
log3(`Applying ${_BaseUser.designDocs.length} design docs`);
|
|
2119
2133
|
for (const doc of _BaseUser.designDocs) {
|
|
2134
|
+
log3(`Applying design doc: ${doc._id}`);
|
|
2120
2135
|
try {
|
|
2121
2136
|
try {
|
|
2122
2137
|
const existingDoc = await this.remoteDB.get(doc._id);
|
|
@@ -2215,8 +2230,13 @@ Currently logged-in as ${this._username}.`
|
|
|
2215
2230
|
async deduplicateReviews() {
|
|
2216
2231
|
try {
|
|
2217
2232
|
log3("Starting deduplication of scheduled reviews...");
|
|
2233
|
+
log3(`Remote DB name: ${this.remoteDB.name || "unknown"}`);
|
|
2234
|
+
log3(`Write DB name: ${this.writeDB.name || "unknown"}`);
|
|
2218
2235
|
const reviewsMap = {};
|
|
2219
2236
|
const duplicateDocIds = [];
|
|
2237
|
+
log3(
|
|
2238
|
+
`Attempting to query remoteDB for reviewCards/reviewCards. Database: ${this.remoteDB.name || "unknown"}`
|
|
2239
|
+
);
|
|
2220
2240
|
const scheduledReviews = await this.remoteDB.query("reviewCards/reviewCards");
|
|
2221
2241
|
log3(`Found ${scheduledReviews.rows.length} scheduled reviews to process`);
|
|
2222
2242
|
scheduledReviews.rows.forEach((r) => {
|
|
@@ -2251,6 +2271,17 @@ Currently logged-in as ${this._username}.`
|
|
|
2251
2271
|
}
|
|
2252
2272
|
} catch (error) {
|
|
2253
2273
|
log3(`Error during review deduplication: ${error}`);
|
|
2274
|
+
if (error && typeof error === "object" && "status" in error && error.status === 404) {
|
|
2275
|
+
log3(
|
|
2276
|
+
`Database not found (404) during review deduplication. Database: ${this.remoteDB.name || "unknown"}`
|
|
2277
|
+
);
|
|
2278
|
+
log3(
|
|
2279
|
+
`This might indicate the user database doesn't exist or the reviewCards view isn't available`
|
|
2280
|
+
);
|
|
2281
|
+
}
|
|
2282
|
+
if (error && typeof error === "object") {
|
|
2283
|
+
log3(`Full error details: ${JSON.stringify(error)}`);
|
|
2284
|
+
}
|
|
2254
2285
|
}
|
|
2255
2286
|
}
|
|
2256
2287
|
/**
|