diff --git a/src/json-crdt-patch/codec/binary/Decoder.ts b/src/json-crdt-patch/codec/binary/Decoder.ts index e45b892e0b..ed0e00edd5 100644 --- a/src/json-crdt-patch/codec/binary/Decoder.ts +++ b/src/json-crdt-patch/codec/binary/Decoder.ts @@ -29,8 +29,12 @@ export class Decoder extends CborDecoder { * @returns A JSON CRDT patch. */ public decode(data: Uint8Array): Patch { + this.reader.reset(data); + return this.readPatch(); + } + + public readPatch(): Patch { const reader = this.reader; - reader.reset(data); const sid = reader.vu57(); const time = reader.vu57(); const isServerClock = sid === SESSION.SERVER;