@liveblocks/core 1.2.2-test3 → 1.2.2-test5

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.
package/dist/index.d.mts CHANGED
@@ -856,6 +856,7 @@ declare type YDocUpdate = {
856
856
  readonly type: ServerMsgCode.UPDATE_YDOC;
857
857
  readonly update: string;
858
858
  readonly isSync: boolean;
859
+ readonly stateVector: string | null;
859
860
  };
860
861
  /**
861
862
  * Sent by the WebSocket server and broadcasted to all clients to announce that
package/dist/index.d.ts CHANGED
@@ -856,6 +856,7 @@ declare type YDocUpdate = {
856
856
  readonly type: ServerMsgCode.UPDATE_YDOC;
857
857
  readonly update: string;
858
858
  readonly isSync: boolean;
859
+ readonly stateVector: string | null;
859
860
  };
860
861
  /**
861
862
  * Sent by the WebSocket server and broadcasted to all clients to announce that
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/version.ts
2
2
  var PKG_NAME = "@liveblocks/core";
3
- var PKG_VERSION = "1.2.2-test3";
3
+ var PKG_VERSION = "1.2.2-test5";
4
4
  var PKG_FORMAT = "cjs";
5
5
 
6
6
  // src/dupe-detection.ts
@@ -2212,6 +2212,9 @@ var LiveList = class _LiveList extends AbstractCrdt {
2212
2212
  if (deletedDelta) {
2213
2213
  delta.push(deletedDelta);
2214
2214
  }
2215
+ if (this._unacknowledgedDeletedIds.has(nn(op.deletedId))) {
2216
+ this._unacknowledgedDeletedIds.delete(nn(op.deletedId));
2217
+ }
2215
2218
  const unacknowledgedOpId = this._unacknowledgedSets.get(op.parentKey);
2216
2219
  if (unacknowledgedOpId !== void 0) {
2217
2220
  if (unacknowledgedOpId !== op.opId) {
@@ -2220,10 +2223,6 @@ var LiveList = class _LiveList extends AbstractCrdt {
2220
2223
  this._unacknowledgedSets.delete(op.parentKey);
2221
2224
  }
2222
2225
  }
2223
- if (this._unacknowledgedDeletedIds.has(op.id)) {
2224
- this._unacknowledgedDeletedIds.delete(op.id);
2225
- return delta.length === 0 ? { modified: false } : { modified: makeUpdate(this, delta), reverse: [] };
2226
- }
2227
2226
  const indexOfItemWithSamePosition = this._indexOfPosition(op.parentKey);
2228
2227
  const existingItem = this._items.find((item) => item._id === op.id);
2229
2228
  if (existingItem !== void 0) {
@@ -5281,10 +5280,14 @@ ${Array.from(traces).join("\n\n")}`
5281
5280
  };
5282
5281
  }
5283
5282
  function fetchYDoc(vector) {
5284
- context.buffer.messages.push({
5285
- type: 300 /* FETCH_YDOC */,
5286
- vector
5287
- });
5283
+ if (!context.buffer.messages.find((m) => {
5284
+ return m.type === 300 /* FETCH_YDOC */ && m.vector === vector;
5285
+ })) {
5286
+ context.buffer.messages.push({
5287
+ type: 300 /* FETCH_YDOC */,
5288
+ vector
5289
+ });
5290
+ }
5288
5291
  flushNowOrSoon();
5289
5292
  }
5290
5293
  function undo() {