@dabble/patches 0.7.19 → 0.7.20

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.
@@ -158,9 +158,6 @@ class LWWInMemoryStore {
158
158
  for (const op of buf.sendingChange.ops) {
159
159
  buf.committedFields.set(op.path, op.value);
160
160
  }
161
- if (buf.sendingChange.rev > buf.committedRev) {
162
- buf.committedRev = buf.sendingChange.rev;
163
- }
164
161
  buf.sendingChange = null;
165
162
  }
166
163
  /**
@@ -243,10 +243,6 @@ class LWWIndexedDBStore {
243
243
  return;
244
244
  }
245
245
  await Promise.all(sending.change.ops.map((op) => committedOps.put({ ...op, docId })));
246
- const docMeta = await docsStore.get(docId) ?? { docId, committedRev: 0, algorithm: "lww" };
247
- if (sending.change.rev > docMeta.committedRev) {
248
- await docsStore.put({ ...docMeta, committedRev: sending.change.rev });
249
- }
250
246
  await sendingChanges.delete(docId);
251
247
  await tx.complete();
252
248
  }
@@ -149,6 +149,7 @@ class Patches {
149
149
  if (managed) {
150
150
  managed.unsubscribe();
151
151
  this.docs.delete(docId);
152
+ this._changeQueues.delete(docId);
152
153
  if (untrack) {
153
154
  await this.untrackDocs([docId]);
154
155
  }
@@ -187,6 +188,7 @@ class Patches {
187
188
  async close() {
188
189
  this.docs.forEach((managed) => managed.unsubscribe());
189
190
  this.docs.clear();
191
+ this._changeQueues.clear();
190
192
  await Promise.all(Object.values(this.algorithms).map((s) => s?.close()));
191
193
  this.onChange.clear();
192
194
  this.onDeleteDoc.clear();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dabble/patches",
3
- "version": "0.7.19",
3
+ "version": "0.7.20",
4
4
  "description": "Immutable JSON Patch implementation based on RFC 6902 supporting operational transformation and last-writer-wins",
5
5
  "author": "Jacob Wright <jacwright@gmail.com>",
6
6
  "bugs": {