diff --git a/INTERNALS.md b/INTERNALS.md index a7874076..4daf9659 100644 --- a/INTERNALS.md +++ b/INTERNALS.md @@ -149,8 +149,8 @@ concepts that can be used to create a custom network protocol: * `update`: The Yjs document can be encoded to an *update* object that can be parsed to reconstruct the document. Also every change on the document fires -an incremental document updates that allows clients to sync with each other. -The update object is an Uint8Array that efficiently encodes `Item` objects and +an incremental document update that allows clients to sync with each other. +The update object is a Uint8Array that efficiently encodes `Item` objects and the delete set. * `state vector`: A state vector defines the known state of each user (a set of tuples `(client, clock)`). This object is also efficiently encoded as a diff --git a/README.md b/README.md index f15e5ea5..199e926e 100644 --- a/README.md +++ b/README.md @@ -789,7 +789,7 @@ const diff2 = Y.diffUpdate(currentState2, stateVector1) // sync clients currentState1 = Y.mergeUpdates([currentState1, diff2]) -currentState1 = Y.mergeUpdates([currentState1, diff1]) +currentState2 = Y.mergeUpdates([currentState2, diff1]) ``` #### Obfuscating Updates diff --git a/package-lock.json b/package-lock.json index b2919577..2e7e7879 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "yjs", - "version": "13.6.7", + "version": "13.6.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "yjs", - "version": "13.6.7", + "version": "13.6.8", "license": "MIT", "dependencies": { - "lib0": "^0.2.74" + "lib0": "^0.2.86" }, "devDependencies": { "@rollup/plugin-commonjs": "^24.0.1", @@ -2481,9 +2481,9 @@ } }, "node_modules/lib0": { - "version": "0.2.74", - "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.74.tgz", - "integrity": "sha512-roj9i46/JwG5ik5KNTkxP2IytlnrssAkD/OhlAVtE+GqectrdkfR+pttszVLrOzMDeXNs1MPt6yo66MUolWSiA==", + "version": "0.2.86", + "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.86.tgz", + "integrity": "sha512-kxigQTM4Q7NwJkEgdqQvU21qiR37twcqqLmh+/SbiGbRLfPlLVbHyY9sWp7PwXh0Xus9ELDSjsUOwcrdt5yZ4w==", "dependencies": { "isomorphic.js": "^0.2.4" }, @@ -2492,7 +2492,7 @@ "0serve": "bin/0serve.js" }, "engines": { - "node": ">=14" + "node": ">=16" }, "funding": { "type": "GitHub Sponsors ❤", diff --git a/package.json b/package.json index dd8eacb0..eaeac95b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yjs", - "version": "13.6.7", + "version": "13.6.8", "description": "Shared Editing Library", "main": "./dist/yjs.cjs", "module": "./dist/yjs.mjs", @@ -75,7 +75,7 @@ }, "homepage": "https://docs.yjs.dev", "dependencies": { - "lib0": "^0.2.74" + "lib0": "^0.2.86" }, "devDependencies": { "@rollup/plugin-commonjs": "^24.0.1", diff --git a/src/structs/Item.js b/src/structs/Item.js index 7e1bc92c..c14778b3 100644 --- a/src/structs/Item.js +++ b/src/structs/Item.js @@ -389,9 +389,8 @@ export class Item extends AbstractStruct { } if ((this.left && this.left.constructor === GC) || (this.right && this.right.constructor === GC)) { this.parent = null - } - // only set parent if this shouldn't be garbage collected - if (!this.parent) { + } else if (!this.parent) { + // only set parent if this shouldn't be garbage collected if (this.left && this.left.constructor === Item) { this.parent = this.left.parent this.parentSub = this.left.parentSub