Comments (7)
@akatakritos from the update binary format perspective, the only information about root-level type passed is its name. The information about type of that structure is not passed as part of the update.
For root-level types, you're expected to create them after initialising the Document. The fact that this is not enforced behaviour is due to compatibility with Yjs API, which allows you to create them at any time for convenience, however it's advised to make it during Doc initialisation as well.
from ydotnet.
I will have a look, but it looks like something went wrong with the transmit, because it could not find the proper type. Therefore 0
from ydotnet.
Thanks! I think it transmitted; if I define the name
field with remoteDoc.Text("name")
after applying updates (right before opening the last ReadTransaction in the test), the field and its value can be successfully retrieved. Its like you have to explicitly define fields even if they come in from a remote sync
from ydotnet.
Could you ask that in the ycrdt repo. I am actually not sure right now
from ydotnet.
Sure! I'll see if I can figure out a reproduction using straight rust. Thanks!
from ydotnet.
https://www.bartoszsypytkowski.com/yrs-architecture/
These types can be nested in each other according to their limitations. Unlike primitive values they can also be assigned to the document itself (using their unique names for retrieval) and obtained right from it. Shared objects created straight at the document level are called a root level types and have a very interesting characteristic - their actual type is only a suggestion on how to present their content
...
This structure also enables to reinterpret root-level types eg. you can read a Text as an Array (to change its materialized type to a list of characters) or XmlElement as a Map (and be able to read only its attributes). Just like with any other kind of weakly typed systems you should use these capabilities with caution.
My interpretation of this is that it's by design to get a 0 back from rust. Top level properties are flexibly typed, if you don't declare that it's an Array or whatever it doesn't know how to interpret it.
Maybe we should keep throwing here but perhaps special case the 0 and throw a message informing the user to declare the type before trying to read it?
Or add an enum element for Undeclared = 0? That might just be an implementation quirk though
from ydotnet.
Thanks for the info! That's basically what I've come to understand. Maybe the only improvement this issue could represent is a slightly clearer exception message that guides the user towards declaring the field at Doc init time.
from ydotnet.
Related Issues (20)
- NuGet handle HOT 3
- Fix Publish workflow HOT 1
- Integrate new method ytransaction_alive HOT 5
- Demo client project problems HOT 3
- Improve the README
- Update to .NET 8
- Fix unit tests
- WebSocket Client HOT 1
- Use `y-crdt/y-crdt` to build the Rust binaries
- Unable to load shared library 'yrs' or one of its dependencies. HOT 8
- Is there any way to use SignalR? HOT 5
- Support for Weak Types?
- How would you persist the data in SQL Server? HOT 3
- Initial sync not working on latest version of the codebase. HOT 2
- v0.2.13 release? HOT 1
- YDotnet.Extensions: Exception converting Map to strongly typed model HOT 1
- Exception in Rust code bringing the entire dotnet server down HOT 5
- YDotNet stops persisting to storage after 1st invalidation HOT 36
- Update core bindings to Yrs v0.18 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ydotnet.