@vue-skuilder/db 0.1.11-12 → 0.1.11-13

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.
@@ -2095,7 +2095,12 @@ Currently logged-in as ${this._username}.`
2095
2095
  this.setDBandQ();
2096
2096
  this.syncStrategy.startSync(this.localDB, this.remoteDB);
2097
2097
  void this.applyDesignDocs();
2098
- void this.deduplicateReviews();
2098
+ this.deduplicateReviews().catch((error) => {
2099
+ log3(`Error in deduplicateReviews background task: ${error}`);
2100
+ if (error && typeof error === "object") {
2101
+ log3(`Full error details in background task: ${JSON.stringify(error)}`);
2102
+ }
2103
+ });
2099
2104
  _BaseUser._initialized = true;
2100
2105
  }
2101
2106
  static designDocs = [
@@ -2215,8 +2220,13 @@ Currently logged-in as ${this._username}.`
2215
2220
  async deduplicateReviews() {
2216
2221
  try {
2217
2222
  log3("Starting deduplication of scheduled reviews...");
2223
+ log3(`Remote DB name: ${this.remoteDB.name || "unknown"}`);
2224
+ log3(`Write DB name: ${this.writeDB.name || "unknown"}`);
2218
2225
  const reviewsMap = {};
2219
2226
  const duplicateDocIds = [];
2227
+ log3(
2228
+ `Attempting to query remoteDB for reviewCards/reviewCards. Database: ${this.remoteDB.name || "unknown"}`
2229
+ );
2220
2230
  const scheduledReviews = await this.remoteDB.query("reviewCards/reviewCards");
2221
2231
  log3(`Found ${scheduledReviews.rows.length} scheduled reviews to process`);
2222
2232
  scheduledReviews.rows.forEach((r) => {
@@ -2251,6 +2261,17 @@ Currently logged-in as ${this._username}.`
2251
2261
  }
2252
2262
  } catch (error) {
2253
2263
  log3(`Error during review deduplication: ${error}`);
2264
+ if (error && typeof error === "object" && "status" in error && error.status === 404) {
2265
+ log3(
2266
+ `Database not found (404) during review deduplication. Database: ${this.remoteDB.name || "unknown"}`
2267
+ );
2268
+ log3(
2269
+ `This might indicate the user database doesn't exist or the reviewCards view isn't available`
2270
+ );
2271
+ }
2272
+ if (error && typeof error === "object") {
2273
+ log3(`Full error details: ${JSON.stringify(error)}`);
2274
+ }
2254
2275
  }
2255
2276
  }
2256
2277
  /**