fix disconnect issue

This commit is contained in:
Kevin Jahns 2021-11-19 17:27:23 +01:00
parent 8b82c573c4
commit a057bf1cf0
2 changed files with 5 additions and 6 deletions

View File

@ -289,13 +289,12 @@ export class ListIterator {
/** /**
* @type {Item | null} * @type {Item | null}
*/ */
let item = this.nextItem
if (this.rel > 0) { if (this.rel > 0) {
/** /**
* @type {ID} * @type {ID}
*/ */
const itemid = /** @type {Item} */ (item).id const itemid = /** @type {Item} */ (this.nextItem).id
item = getItemCleanStart(tr, createID(itemid.client, itemid.clock + this.rel)) this.nextItem = getItemCleanStart(tr, createID(itemid.client, itemid.clock + this.rel))
this.rel = 0 this.rel = 0
} }
const parent = this.type const parent = this.type
@ -358,12 +357,11 @@ export class ListIterator {
}) })
packJsonContent() packJsonContent()
if (right === null && left !== null) { if (right === null && left !== null) {
item = left this.nextItem = left
this.reachedEnd = true this.reachedEnd = true
} else { } else {
item = right this.nextItem = right
} }
this.nextItem = item
} }
/** /**

View File

@ -327,6 +327,7 @@ export const testFormattingDeltaUnnecessaryAttributeChange = tc => {
* @param {t.TestCase} tc * @param {t.TestCase} tc
*/ */
export const testInsertAndDeleteAtRandomPositions = tc => { export const testInsertAndDeleteAtRandomPositions = tc => {
// @todo optimize to run at least as fast as previous marker approach
const N = 100000 const N = 100000
const { text0 } = init(tc, { users: 1 }) const { text0 } = init(tc, { users: 1 })
const gen = tc.prng const gen = tc.prng