@abraca/dabra 1.3.2 → 1.3.4

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.
@@ -3067,6 +3067,7 @@ var AbracadabraProvider = class AbracadabraProvider extends AbracadabraBaseProvi
3067
3067
  if (origin === this) return;
3068
3068
  if (this.offlineStore !== null && origin === this.offlineStore) return;
3069
3069
  this.offlineStore?.persistUpdate(update).catch(() => null);
3070
+ if (!this.canWrite) return;
3070
3071
  super.documentUpdateHandler(update, origin);
3071
3072
  }
3072
3073
  /**
@@ -3080,6 +3081,7 @@ var AbracadabraProvider = class AbracadabraProvider extends AbracadabraBaseProvi
3080
3081
  * errors across async await boundaries.
3081
3082
  */
3082
3083
  async flushPendingUpdates() {
3084
+ if (!this.canWrite) return;
3083
3085
  const store = this.offlineStore;
3084
3086
  if (!store) return;
3085
3087
  const updates = await store.getPendingUpdates();
@@ -10895,8 +10897,9 @@ var E2EAbracadabraProvider = class E2EAbracadabraProvider extends AbracadabraPro
10895
10897
  function attachUpdatedAtObserver(treeMap, childDocId, childDoc, offlineStore) {
10896
10898
  function handler(update, origin) {
10897
10899
  if (offlineStore !== null && origin === offlineStore) return;
10898
- const entry = treeMap.get(childDocId);
10899
- if (!entry) return;
10900
+ const raw = treeMap.get(childDocId);
10901
+ if (!raw) return;
10902
+ const entry = raw instanceof yjs.Map ? raw.toJSON() : raw;
10900
10903
  treeMap.set(childDocId, {
10901
10904
  ...entry,
10902
10905
  updatedAt: Date.now()