You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got a bug report for our .NET wrapper. The code example is as followed:
var localDoc = new Doc();
var localText = localDoc.Text("name");
using (var tx = localDoc.WriteTransaction())
{
localText.Insert(tx, 0, "Y-CRDT");
tx.Commit();
}
var remoteDoc = new Doc();
byte[] remoteState;
// Get the remote document state vector.
using (var tx = remoteDoc.ReadTransaction())
{
remoteState = tx.StateVectorV1();
tx.Commit();
}
byte[] stateDiff;
using (var tx = localDoc.ReadTransaction())
{
stateDiff = tx.StateVectorV1();
tx.Commit();
}
using (var tx = localDoc.WriteTransaction())
{
tx.ApplyV1(stateDiff);
tx.Commit();
}
using (var tx = remoteDoc.ReadTransaction())
{
Text? textProperty = tx.GetText("name");
// as a new user, I expected this to return the Text since the sync should have created
// it.
// Instead, the docs state it should be null: "Returns the Text at the Doc root level, identified by name,
// or null if no entry was defined under name before." However, it throws instead.
Assert.NotNull(textProperty);
}
The user asked if it is by design that the does not see the root, if he uses the code above. I was also not sure about this and whether he or I made something wrong. Could also be a bug ofc.
The text was updated successfully, but these errors were encountered:
Yes, applying updates should create (temporarily) untyped roots if they were not defined before. We have tests that confirm that behaviour in yrs and (I think) in ywasm. I'll check it out for C bindings, but the code is very straightforward.
Hi,
I got a bug report for our .NET wrapper. The code example is as followed:
The user asked if it is by design that the does not see the root, if he uses the code above. I was also not sure about this and whether he or I made something wrong. Could also be a bug ofc.
The text was updated successfully, but these errors were encountered: