@abraca/dabra 1.0.18 → 1.0.19

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.
@@ -2714,8 +2714,10 @@ var OfflineStore = class {
2714
2714
  }
2715
2715
  destroy() {
2716
2716
  this._destroyed = true;
2717
+ const db = this.db;
2717
2718
  this.db = null;
2718
2719
  this.dbPromise = null;
2720
+ if (db) Promise.resolve().then(() => db.close());
2719
2721
  }
2720
2722
  };
2721
2723
 
@@ -8574,10 +8576,12 @@ var BackgroundSyncManager = class extends EventEmitter {
8574
8576
  }
8575
8577
  }
8576
8578
  async _syncNonE2EDoc(docId) {
8579
+ const alreadyCached = this.rootProvider.children.has(docId);
8577
8580
  const childProvider = await this.rootProvider.loadChild(docId);
8578
8581
  await childProvider.ready;
8579
8582
  await this._waitForSynced(childProvider);
8580
8583
  if (this.opts.prefetchFiles && this.fileBlobStore) this._prefetchDocFiles(docId, childProvider.document).catch(() => null);
8584
+ if (!alreadyCached) this.rootProvider.unloadChild(docId);
8581
8585
  return {
8582
8586
  docId,
8583
8587
  status: "synced",