After review of mr !60 (closed) leaves it in a mergeable state, and for a first approximation to MVP (which is what 0.9.3 is about), we kind of agree that we want to merge something even though it assumes that we have connectivity, and iterate over it later on.
in the future it would be good to decouple uploads/downloads behind a unified sync manager that can do nice things like pooling and bandwith throttling, but let's move in incremental steps.
For creating issues for coming steps, I think a good stage would be what drebs suggested of exposing get_blob() and put_blob() in the soledad client api (and thus leaving the responsibility to the users of soledad: aka bitmask.mail) and then fail gracefully if a network transfer fails for whatever reason. IMHO, before proceededing to network error handling, we need to reach some consensus re. #8690, so that we can keep the metadata of the blobs network transfer.
as we've been discussing in the leap-python-dev thread, it might not make sense to overload the get_doc() / create_doc() methods,
but add some blob-specific calls.
however, I think the creation of an empty document with the pointer to the blob_id is still valid:
if self.blobs and isinstance(content, BytesIO): blob_id = uuid.uuid4().get_hex() _content = {'is_blob': True, 'blob_id': blob_id}
The only thing I still don't see clearly is how to take the decision about getting a doc or a blob.
I'm ok to forcing the users of soledad api to know beforehand (in our case, it will be based on the type of document: basically all content-documents will be treated as blobs).
We have been discussing in many channels how blobs should integrate with soledad. There are currently 2 main possibilities:
Use of blobs is transparent to API user: The idea here is that Soledad decides if/when to use blobs and theuser doesn't need to care.
Use of blobs is explicitelly managed by API user: Differences between blobs and non-blobs documents like indexing (blobs aren't indexed) and json vs file descriptor content manipulation mean that the use of blobs should be exposed and the user should decide when to use it or not.
Some points that I recall from the discussion that made sense to me:
It's easier to do (2) and then (1) if we decide so than the other way round.
We would like soledad+blobs to be a general tool, but right now the decision should depend on the exact use we'll be giving to blobs in the near future. So we should take a look at Bitmask Mail snippets that would use blobs and see if it'd make more sense to do (1) or (2).