@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.
@@ -2744,8 +2744,10 @@ var OfflineStore = class {
2744
2744
  }
2745
2745
  destroy() {
2746
2746
  this._destroyed = true;
2747
+ const db = this.db;
2747
2748
  this.db = null;
2748
2749
  this.dbPromise = null;
2750
+ if (db) Promise.resolve().then(() => db.close());
2749
2751
  }
2750
2752
  };
2751
2753
 
@@ -8626,10 +8628,12 @@ var BackgroundSyncManager = class extends EventEmitter {
8626
8628
  }
8627
8629
  }
8628
8630
  async _syncNonE2EDoc(docId) {
8631
+ const alreadyCached = this.rootProvider.children.has(docId);
8629
8632
  const childProvider = await this.rootProvider.loadChild(docId);
8630
8633
  await childProvider.ready;
8631
8634
  await this._waitForSynced(childProvider);
8632
8635
  if (this.opts.prefetchFiles && this.fileBlobStore) this._prefetchDocFiles(docId, childProvider.document).catch(() => null);
8636
+ if (!alreadyCached) this.rootProvider.unloadChild(docId);
8633
8637
  return {
8634
8638
  docId,
8635
8639
  status: "synced",