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

View File

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