@abraca/dabra 2.30.0 → 2.31.0

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.
@@ -3282,6 +3282,19 @@ var AbracadabraProvider = class AbracadabraProvider extends AbracadabraBaseProvi
3282
3282
  return this.childProviders.has(childId);
3283
3283
  }
3284
3284
  /**
3285
+ * Whether a loaded child is currently transient — loaded with
3286
+ * `{ evictable: false }` (e.g. by a background indexer/sync) and not since
3287
+ * promoted to a normal UI-held child. A later `loadChild(id)` with the
3288
+ * default `evictable: true` clears this flag.
3289
+ *
3290
+ * Background loaders use this to decide whether they still own a child
3291
+ * before unloading it: if the UI opened the same doc mid-sync, the child is
3292
+ * no longer transient and must NOT be destroyed out from under the view.
3293
+ */
3294
+ isChildTransient(childId) {
3295
+ return this.transientChildren.has(childId);
3296
+ }
3297
+ /**
3285
3298
  * Create (or return cached) a child AbracadabraProvider for a given
3286
3299
  * child document id. Each child shares the parent's WebSocket via
3287
3300
  * multiplexing.
@@ -16484,7 +16497,7 @@ var BackgroundSyncManager = class extends EventEmitter {
16484
16497
  isE2E: false
16485
16498
  };
16486
16499
  }
16487
- const childProvider = await this.rootProvider.loadChild(docId);
16500
+ const childProvider = await this.rootProvider.loadChild(docId, { evictable: false });
16488
16501
  try {
16489
16502
  await childProvider.ready;
16490
16503
  await this._waitForSynced(childProvider);
@@ -16508,7 +16521,9 @@ var BackgroundSyncManager = class extends EventEmitter {
16508
16521
  isE2E: false
16509
16522
  };
16510
16523
  } finally {
16511
- if (!alreadyCached) this.rootProvider.unloadChild(docId);
16524
+ if (!alreadyCached) {
16525
+ if (typeof this.rootProvider.isChildTransient === "function" ? this.rootProvider.isChildTransient(docId) : true) this.rootProvider.unloadChild(docId);
16526
+ }
16512
16527
  }
16513
16528
  }
16514
16529
  async _syncE2EDoc(docId) {