diff --git a/packages/sdk/src/document/change/change_id.ts b/packages/sdk/src/document/change/change_id.ts index 74e09ee2c..fb7c53ae6 100644 --- a/packages/sdk/src/document/change/change_id.ts +++ b/packages/sdk/src/document/change/change_id.ts @@ -131,7 +131,7 @@ export class ChangeID { } /** - * `setVersionVector` sets the given actor. + * `setVersionVector` sets the given version vector. */ public setVersionVector(versionVector: VersionVector): ChangeID { return new ChangeID( diff --git a/packages/sdk/src/document/time/version_vector.ts b/packages/sdk/src/document/time/version_vector.ts index 527fdfda4..97da9ae3b 100644 --- a/packages/sdk/src/document/time/version_vector.ts +++ b/packages/sdk/src/document/time/version_vector.ts @@ -95,7 +95,7 @@ export class VersionVector { public afterOrEqual(other: TimeTicket) { const lamport = this.vector.get(other.getActorID()); - if (!lamport) { + if (lamport === undefined) { return false; } @@ -122,7 +122,7 @@ export class VersionVector { for (const [actorID] of versionVector) { const lamport = this.vector.get(actorID); - if (lamport) { + if (lamport !== undefined) { filtered.set(actorID, lamport); } }