-
Notifications
You must be signed in to change notification settings - Fork 347
Fix fast LiveList.insert + LiveList.set bug #1002
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
Conversation
@@ -870,7 +892,7 @@ export class LiveList<TItem extends Lson> extends AbstractCrdt { | |||
this._pool?.assertStorageIsWritable(); | |||
if (index < 0 || index > this._items.length) { | |||
throw new Error( | |||
`Cannot insert list item at index "${index}". index should be between 0 and ${this._items.length}` | |||
`Cannot insert list item at index "${index}". index should be between 0 and ${this._items.length}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These error messages included some invisible characters between "
and $
]); | ||
|
||
expectStorage({ | ||
items: ["B"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the fix, items were equal to ["A","B"]
here.
…ledgedDeletedIds fix
…locks into livelist-insert-set-bug
Hi @GuillaumeSalles, we believe that we're hitting the error that this PR intends to fix. Do you know when we should expect more update here? We're happy to help test out the fix if you can publish an updated |
Description
This PR ensures that insert acknowledge op is ignored if the item has been deleted by a local
LiveList.set
.I took the opportunity to add comments and do some cleanups.
Before merging this, we need to make sure e2e tests are passing on public and private repositories. (We might need to fix our tests setup to work with ESM)
Review commit by commit recommended
How to test it
Upgrade our block based editor example to use
1.2.2-test3
and try to reproduce the behavior described in #731. This should also fix the "ghosting bug" mentioned by Fermat and Arcol.Related issue(s)
set
results in delete/insert events #628