webxdc/checklist
15
2
Fork
You've already forked checklist
3

fix: first added item getting deleted sometimes #43

Merged
WofWca merged 1 commit from fix-init-override into master 2023年11月20日 11:14:45 +01:00

when two or more users add an item on an empty list at the same time

when two or more users add an item on an empty list at the same time
WofWca force-pushed fix-init-override from c12bdbee1c to 40d7b4801d 2023年09月15日 15:20:15 +02:00 Compare
r10s left a comment
Copy link

weird, somehow

approving code - i am not deep into this CRDT thing, to judge that semantically. i would appreciate at least one more review, eg. from @rtn or Aaron

does yjs has the same problem?

weird, somehow approving code - i am not deep into this CRDT thing, to judge that semantically. i would appreciate at least one more review, eg. from @rtn or Aaron does yjs has the same problem?
Author
Owner
Copy link

i am not deep into this CRDT thing

Me neither. Basically it's just about two peers doing doc.items = [] at the same time.

> i am not deep into this CRDT thing Me neither. Basically it's just about two peers doing `doc.items = []` at the same time.
Author
Owner
Copy link

does yjs has the same problem?

No, the API is different there. You'd do doc.getArray('items') every time, you don't have to initialize it.

> does yjs has the same problem? No, the API is different there. You'd do `doc.getArray('items')` every time, you don't have to initialize it.
ansuz left a comment
Copy link

I'm a little surprised that automerge doesn't treat the empty document as a universally shared point in history. The fact that this type of hardcoded patch is necessary seems more like an unfortunate implementation detail than a theoretical necessity. In any case, this seems like the right solution.

The following section in the docs suggests there will be more challenges with automerge-based apps when we get around to supporting app updates, so I'll keep an eye on this.

Nice fix and thanks for highlighting this issue!

I'm a little surprised that automerge doesn't treat the _empty document_ as a universally shared point in history. The fact that this type of hardcoded patch is necessary seems more like an unfortunate implementation detail than a theoretical necessity. In any case, this seems like the right solution. The following section in the docs suggests there will be more challenges with automerge-based apps when we get around to supporting app updates, so I'll keep an eye on this. Nice fix and thanks for highlighting this issue!
Author
Owner
Copy link

the empty document

To be precise, it's not about an empty document, but rather an empty array/list. An empty document does act as a shared point. But yeah, as I said, Yjs, for example, is devoid of this problem.

> the empty document To be precise, it's not about an empty document, but rather an empty array/list. An empty document _does_ act as a shared point. But yeah, as I said, Yjs, for example, is devoid of this problem.
Author
Owner
Copy link

Thanks for reviewing!

Thanks for reviewing!
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
webxdc/checklist!43
Reference in a new issue
webxdc/checklist
No description provided.
Delete branch "fix-init-override"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?