I have to be careful with what I assert here because of the swiss cheese holes in the non-existant JS SDK.
In broad terms (for the revit connector, let’s say), the exchange with Speckle goes something like this.
You create a list of speckle objects according to a hierarchy; it could be a flat list.
Serializing that to account for detachment and chunking will create additional objects and replace them with references
Sending these objects 1st time will create a copy on the server of every object.
Creating a commit is a separate mutation describing that “packet” of information, a selection says.
The second time you send that same selection, it is equivalent to changing some values in any selected object.
5. That selected list of objects is converted to speckle objects
6. The Transport operation diffs the server’s existing objects (unchanged) from the change. Unchanged objects are replaced with Reference objects
7. A commit is made with an amalgam of those references and changed objects.
The web viewer and receiver connectors handle the reference objects and substitute them for db calls to the original objects.
NOW, how much of that handshaking exists in the JS world? I need to refresh myself on this. I’d appreciate it if @connor, @oguzhankoral, or @Jedd could chime in.
Alright, that is a little bit what I expected happened.
Then what I want to know is what is the structure of the diff?
What I have sent as the second commit in my example, is the objects that got updated, basically I need to wrap them in a diff structure, so Speckle handles them correctly
@jonathon could you guide me to where the 6. The Transport operation diffs the server’s existing objects (unchanged) from the change. happens in the Revit Connector?
I wanted to try to deduce what happens myself, but I can’t find the right code snippets in the speckle-sharp repo.