Discussions related to Shared Editing, Distributed Apps, and Yjs. Questions about Yjs should go to discuss.yjs.dev. Bug reports to the issue tracker.
You can merge updates manually by calling
```js
import { storeState } from 'y-indexeddb'
storeState(indexeddbPersistence, true)
@dmonad why does y-websocket
broadcast a sync step 2 during websocket connection: https://github.com/yjs/y-websocket/blob/master/src/y-websocket.js#L354 ? It's being called with an undefined
state vector that will result in the entire state being encoded as an update and sent.
On a similar vein, if two client documents produce the same state vector do they need to exchange updates?
On a similar vein, if two client documents produce the same state vector do they need to exchange updates?
Yes
Hi, I'd like to ask you a question.I used Y.Undomanager. When multiple clients modify the same data, a problem occurred that I did not solve.
for example,
Client A:
At this time,when Client A presses Command + Z, I want the data to be restored to {a: 'aaa'}, but it actually removed that data.
How to solve this situation?
share
map in a Doc
with doc.share.delete('<array_key>')
? I'm getting an unexpected case
error when I do that and then try to encodeStateAsUpdate
. Maybe I'm doing it the wrong way—the goal is to be able to have a removed Array
in one doc sync to another doc.
Hey folks, just want to come back and say I have a really positive experience with Yjs so far. It significantly helped us resolve many perf issues we had with Automerge. So we could ship our end product with good quality bar. Love it!
I do have one follow up question though. In some of our use cases, we would like to have some control over how we want Yjs to resolve conflicts on value reassignment.
Example 1 - We would like end users to resolve conflicts themselves:
Let's say we have YDoc { "key": "someValue" } where two nodes A and B update it regularly. Sometimes, A and B may update {"key": "valueA" } and {"key": "valueB"} at the same time. In such case, only "valueA" or "valueB" is picked by yjs and the unpicked value would be dropped. However we would love Yjs to notify us when it happens so our product code could pass this two writes to users to decide which value they want.
Example 2 - We would like to minimise the chance of an old write overwriting a newer write.
Let's say we have YDoc { "key": 0 } where a group of nodes update it regularly. This yDoc keeps getting updated by a number of nodes. And after some time, yDoc becomes {"key": 9999}. One of the node had some network issues from the start so it still sees the initial value 0. Now this old node gets network recovered and it starts to set the value to {"key": 1}. Currently this could overwrite the latest value { "key": 9999 } which is bad in many of use cases. So we would like to somehow detect some update is based on a really old version so it would be "deprioritized" when CRDT merges the value.
Does anyone have any thoughts on how we could gain control of conflict resolution with Yjs? Automerge has a conflict API which helps our examples here so I am wondering if there are some perspective solutions in Yjs too.
Many thanks for reading this long question. Would really appreciate your thoughts.
Good afternoon. I'm trying to build a Yjs-based service for syncing notes, tasks, and browser bookmarks. I feel that Yjs is what I need. But I'm afraid I don't understand how to use it to its full potential yet.
Can someone please advise me? I would be willing to pay. Other than that, my spoken English is not very good; if you speak Russian, that would be awesome :)