From 48a9dc17b2ccd2327246ba02550ee93fae5f9c2a Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Fri, 6 Jun 2025 02:09:24 +0200 Subject: [PATCH] fixed another splicing issue with skips --- src/utils/StructStore.js | 2 +- tests/y-array.tests.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/StructStore.js b/src/utils/StructStore.js index e2b3eca2..27cc6126 100644 --- a/src/utils/StructStore.js +++ b/src/utils/StructStore.js @@ -112,7 +112,7 @@ export const addStruct = (store, struct) => { const diffStart = struct.id.clock - skip.id.clock const diffEnd = skip.id.clock + skip.length - struct.id.clock - struct.length if (diffStart > 0) { - structs.splice(index++, 0, new Skip(createID(struct.id.client, struct.id.clock), diffStart)) + structs.splice(index++, 0, new Skip(createID(struct.id.client, skip.id.clock), diffStart)) } if (diffEnd > 0) { structs.splice(index + 1, 0, new Skip(createID(struct.id.client, struct.id.clock + struct.length), diffEnd)) diff --git a/tests/y-array.tests.js b/tests/y-array.tests.js index c2e9f7c7..8d952257 100644 --- a/tests/y-array.tests.js +++ b/tests/y-array.tests.js @@ -604,7 +604,7 @@ const arrayTransactions = [ * @param {t.TestCase} tc */ export const testRepeatGeneratingYarrayTests6 = tc => { - applyRandomTests(tc, arrayTransactions, 8) + applyRandomTests(tc, arrayTransactions, 6*3) } /**