01:58:52.774‖ WARNING: Couldn't load body/sequence of CBLSavedRevision[itm-..ee61/1-3cba2f866ae42de425f82828079eaf31]: 404 {at -[CBLSavedRevision loadProperties]:215}
(lldb) po revision.properties
{
"_deleted" = 1;
"_id" = "itm-116785a587234b30a62401acd26e00b0";
"_rev" = "2-ef6861107f684520f83202d1cdd9b3c5";
}
NSArray *leafRevisions = [row.document getLeafRevisions:&error];
CBLSavedRevision *revision = [leafRevisions firstObject];
if (revision && !error) {
CBLJSONDict *properties = revision.properties;
if ([(NSNumber *)properties[@"_deleted"] isEqual:@1]) {
revision = revision.parentRevision;
properties = revision.properties;
}
On Oct 23, 2017, at 1:05 AM, Brendan Duddridge <bren...@gmail.com> wrote:I'm trying to restore a deleted document and so I get the leaf revisions, get the first object in the results, and if it has only deletion information, I ask for the revision's parent and then get the parent's properties. But that's throwing the above error for many of the documents.
Looks like the parent revision’s body has been compacted away. CBL doesn’t guarantee to keep past revisions around; it’s not a version-control system. If you’re using SQLite storage they should stick around until you manually compact, though.