Receiving all objects from a commit

Hey @dimitrie,

I hope we are not annoying you all with our questions nowadays. We are migrating our application to Speckle 2.0.

We are trying to get(download) all objects in a stream(in specific branch) as we do with the rest api endpoints in 1.0. We could not find a way to do with REST API endpoints documented, because they need id(s) as input.

If user sends always all objects by using selection filter(View) in Revit connector as an example, we have always whole model in last commit which can be received from server.

However,If user sends whole model(500 objects) in one commit and sends only one new object in next commit, how can we get all objects(501 objects)? Because in this case we have only one object in last commit.



Reading between the lines, I think the problem is in how you’re sending data out. If your applied filter is “All” in Revit, and you send the whole model, then add/modify the model, and send again - you should always have all the objects picked up by the filter (“All” in this case).

Otherwise, regarding

Yep they do; the “commit” model on the server is just a thin metadata wrapper around a “referencedObject”:

That’s the id you need for the REST api “downloading” operation.

1 Like

Thank you for your response!

This is perfect. However, if we edit one property of an object in our own application which communicates with speckle server, we need to commit this change. If we commit this object on our application, the last commit will contains only this object. In this case we would commit only this object instead of comitting all objects.

If our application restarts, how could we get all objects in this stream again? Do we need to search through all commits in this branch?

Okay, I gotcha. To push changes, just maintain the filter. Objects will get picked up and, before going to the server, the SDK does some magic diffing handshakes that won’t send old objects, just the new (changed) ones. This optimisation happens at the Server Transport level, and it works on the highest-latency potential pathway (sending stuff over the internet) where most gains are to be had.

EDIT: to clarify, a commit’s referenced object must represent the whole state at that point in time.

If it’s your own integration, the same applies: just push all the objects you want into a single commit object (conversion happens here too), and push them out. We don’t currently do this, but you could optimise to have an in memory “conversion cache” as well if you want to shave off extra time and are sure that you’re monitoring changes in the revit file properly.

1 Like

Yes actually we are migrating leaDE to Speckle 2.0. So even if I commit all objects for a property change on one object, speckle transports only the changed object and referencedObject of the last commit contains always all objects and we are all happy :slight_smile: We will probably need the cache to monitoring progress in project properly. I let you know if we implement this.

Thank you for your support and amazing work!:slight_smile:

1 Like