Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delta calculate error in transaction #536

Open
tanghaojie opened this issue Jun 6, 2023 · 0 comments
Open

Delta calculate error in transaction #536

tanghaojie opened this issue Jun 6, 2023 · 0 comments
Assignees
Labels

Comments

@tanghaojie
Copy link

Describe the bug
Trasaction calculate delta error, when i swap array order.

To Reproduce
a YArray: [1, 3, 2],
swap the order to: [1, 2, 3], use:

yarray.delete(2, 1)     // delete
yarray.insert(1, [2])   // insert

Put two operate in a transaction like this:

ydoc.transact(() => {
    yarray.delete(2, 1)     // delete
    yarray.insert(1, [2])   // insert
})

the delta is error:
image

If just use two operate, there have 2 correct delta in each event:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants