-
Notifications
You must be signed in to change notification settings - Fork 467
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
Primitive OpId datatype to reference Automerge operations/objects #402
Comments
Hi @rmst, thanks for this suggestion. We could definitely introduce an OpId datatype and use the existing binary format's encoding to store them in a compact and future-proof representation. The simplest API, which you're suggesting, would be to expose an OpId to the application as a string (wrapped in an OpId object), but I wonder if we should go further than that in the API: an OpId is quite a low-level concept, and maybe what is needed is actually a higher-level abstraction? The operation that an OpId points to could be a bunch of different things. If it points at an object creation operation, then the OpId is the ObjectID of that object, and you can use If your primary use case is linking between objects, one existing method you can use is Is there a reason why the Automerge.Table approach is not suitable for your application? |
You're right. Like I said in the Automerge Slack
There might be use cases that might benefit from a general OpId interface but I don't have a concrete one at the moment. |
Okay, thanks for clarifying. My priorities are currently on features for which we have a clear need and which can't sensibly be provided outside of Automerge core. Since that is not the case for this feature, I am going to close this issue until further evidence of a need emerges. |
Don't build tests for docs
Currently, Automerge operations and objects can be referred to by their
OpId
which is a string of the form${counter}@${actorId}
. To refer to these ids within an Automerge document (e.g. for linking between notes) it might be nice to introduce a dedicated primitive datatype in the binary format. This would allow Automerge to automatically update the ids in case their format changes. The interface could look as follows.The text was updated successfully, but these errors were encountered: